<!DOCTYPE html>
<html>
<head>
  <title></title>
  <style>
    body {
      color: white;
      font: 12px Consolas, "Liberation Mono", Courier, monospace;
    }

    canvas {
      background-color: #1a2633;
    }
  </style>
</head>
<body style="background-color: #333333;">
  <script src="../utilities.js"></script>
  <script src="geometry.js"></script>
  <script src="references.js"></script>
  <script src="regionAllocator.js"></script>
  <table>
    <tr>
      <td>

      </td>
    </tr>
    <tr>
      <td>
        <canvas id="a" width="1024" height="512"></canvas>
      </td>
    </tr>
    <tr>
      <td>
        <div id="aResults"></div>
      </td>
    </tr>
  </table>


  <script>
    var Geometry = Shumway.GFX.Geometry;
    var Matrix = Geometry.Matrix;
    var Point = Geometry.Point;
    var OBB = Geometry.OBB;
    var RenderableTileCache = Geometry.RenderableTileCache;
    var TileCache = Geometry.TileCache;

    var a = document.getElementById("a").getContext("2d");

    var aResults = document.getElementById("aResults");

    var W = 1024, H = 512;

    var devicePixelRatio = window.devicePixelRatio || 1;
    var backingStoreRatio = 1;
    var canvas = document.getElementById("a");
    if (devicePixelRatio !== backingStoreRatio) {
      var ratio = devicePixelRatio / backingStoreRatio;
      canvas.width = W * ratio;
      canvas.height = H * ratio;
      canvas.style.width = W + 'px';
      canvas.style.height = H + 'px';
    } else {
      canvas.width = cw;
      canvas.height = ch;
      // this._context.scale(1 / 2, 1 / 2);
    }

  </script>
  <script>

    var points = Point.createEmptyPoints(4);

    function strokeLines(ctx, points) {
      ctx.beginPath();
      ctx.moveTo(points[0].x, points[0].y);
      for (var i = 1; i < 4; i++) {
        ctx.lineTo(points[i].x, points[i].y);
      }
      ctx.closePath();
      ctx.stroke();
    }

    function strokeQuery(ctx, query, t, cache) {
      t.transformRectangle(query, points);
      ctx.beginPath();
      ctx.moveTo(points[0].x, points[0].y);
      for (var i = 1; i < 4; i++) {
        ctx.lineTo(points[i].x, points[i].y);
      }
      ctx.closePath();
      ctx.stroke();
      ctx.strokeRect(0, 0, cache.w, cache.h);
    }

    function testA() {
      var cache = new TileCache(512, 512, 16, 16, 1);
      cache.tiles.forEach(function (t) {
        t.fillStyle = Shumway.ColorStyle.randomStyle();
      });

      var query = new Rectangle(256, 100, 128, 512);

      var transform = Matrix.createIdentity();

      var t = 0;


      setInterval(function () {
        t += 0.02;
        a.clearRect(0, 0, 1024, 1024);

        var transform = Matrix.createIdentity();
        transform.translate(-256, -256);
        transform.rotate(t);
        transform.scale(Math.sin(t), Math.sin(t));
        transform.translate(300, 300);
        var T = Matrix.createIdentity();
        transform.inverse(T);
        var tiles = cache.getTiles(query, T);
        a.strokeStyle = "white";
        a.strokeRect(query.x, query.y, query.w, query.h);

        strokeQuery(a, query, T, cache);

        a.save();
        // a.translate(transform.tx, transform.ty);
        a.setTransform(transform.a, transform.b, transform.c, transform.d, transform.tx, transform.ty);
        for (var i = 0; i < tiles.length; i++) {
          var tile = tiles[i];
          var c = tile.bounds;
          a.fillStyle = tile.fillStyle;
          a.fillRect(c.x, c.y, c.w, c.h);
        }
        a.restore();
      }, 16);
    }

    function testB() {
      var cache = new TileCache(512, 512, 8, 8, 1);
      cache.tiles.forEach(function (t) {
        t.fillStyle = Shumway.ColorStyle.randomStyle();
      });

      var query = new Rectangle(100, 100, 850, 128);

      var transform = Matrix.createIdentity();

      var t = 0;
      setInterval(function () {
        t += 0.01;
        a.clearRect(0, 0, 1024, 1024);

        var transform = Matrix.createIdentity();
        transform.translate(Math.sin(t) * 300, 0);
        transform.rotate(Math.sin(t) / 2);
        var T = Matrix.createIdentity();
        transform.inverse(T);
        var tiles = cache.getTiles(query, T);
        a.strokeStyle = "white";
        a.strokeRect(query.x, query.y, query.w, query.h);
        strokeQuery(a, query, T, cache);
        a.save();
        a.setTransform(transform.a, transform.b, transform.c, transform.d, transform.tx, transform.ty);
        for (var i = 0; i < tiles.length; i++) {
          var tile = tiles[i];
          var c = tile.bounds;
          a.fillStyle = tile.fillStyle;
          a.fillRect(c.x, c.y, c.w, c.h);
        }
        a.restore();
      }, 16);
    }

    function testC() {
      var cache = new TileCache(512, 512, 8, 8, 1);
      cache.tiles.forEach(function (t) {
        t.fillStyle = Shumway.ColorStyle.randomStyle();
      });

      var query = new Rectangle(100, 100, 400, 128);

      var transform = Matrix.createIdentity();

      var t = 0;
      setInterval(function () {
        t += 0.01;
        a.clearRect(0, 0, 1024, 1024);

        var transform = Matrix.createIdentity();
        transform.c = Math.sin(t);
        // transform.translate(Math.sin(t) * 300, 0);
        // transform.rotate(Math.sin(t) / 2);
        var T = Matrix.createIdentity();
        transform.inverse(T);

        var tiles = cache.getTiles(query, T);
        // var tiles = cache.tiles;

        a.strokeStyle = "white";
        a.strokeRect(query.x, query.y, query.w, query.h);

        strokeQuery(a, query, T, cache);

        a.save();
        a.setTransform(transform.a, transform.b, transform.c, transform.d, transform.tx, transform.ty);
        for (var i = 0; i < tiles.length; i++) {
          var tile = tiles[i];
          var c = tile.bounds;
          a.fillStyle = tile.fillStyle;
          a.fillRect(c.x, c.y, c.w, c.h);
        }
        a.restore();
      }, 16);
    }

    function testD() {
      var cache = new TileCache(512, 512, 8, 8, 1);
      cache.tiles.forEach(function (t) {
        t.fillStyle = Shumway.ColorStyle.randomStyle();
      });

      var query = new Rectangle(100, 100, 850, 128);

      var transform = Matrix.createIdentity();

      var t = 0;
      setInterval(function () {
        t += 0.02;

        var r = new Rectangle(0, 0, 100, 100);
        var A = Point.createEmptyPoints(4);
        var B = Point.createEmptyPoints(4);

        var t0 = Matrix.createIdentity();
        t0.translate(200, 200);
        t0.transformRectangle(r, A);

        var t1 = Matrix.createIdentity();
        t1.c = Math.sin(t);
        t1.b = Math.sin(t);
        t1.translate((Math.sin(t) + 1) * 80, (Math.sin(t) + 1) * 80);
        t1.transformRectangle(r, B);

        var oA = new OBB(A);
        var oB = new OBB(B);

        if (oA.intersects(oB)) {
          a.strokeStyle = "red";
        } else {
          a.strokeStyle = "white";
        }

        a.clearRect(0, 0, 1024, 1024);
        a.save();

        strokeLines(a, A);
        strokeLines(a, B);
        a.restore();
      }, 16);
    }

    function createPath(ctx, path, stroke) {

      ctx.moveTo(path[0][0], path[0][1]);
      for (var i = 1; i < path.length; i ++) {
        var cmd = path[i];
        if (cmd.length === 2) {
          ctx.lineTo(cmd[0], cmd[1]);
        } else if (cmd.length === 4) {
          ctx.quadraticCurveTo(cmd[0], cmd[1], cmd[2], cmd[3]);
        }
      }

    }

    function strokeOrFillPolygon(ctx, polygon, stroke) {
      ctx.beginPath();
      ctx.moveTo(polygon[0], polygon[1]);
      for (var i = 2; i < polygon.length; i += 2) {
        ctx.lineTo(polygon[i], polygon[i + 1]);
      }
      if (stroke) {
        ctx.stroke();
      } else {
        ctx.fill("evenodd");
      }
    }

    function testE() {

      var polygon = new Float32Array(128);
      for (var i = 0; i < polygon.length - 2; i += 2) {
        polygon[i + 0] = Math.random() * W;
        polygon[i + 1] = Math.random() * H;
      }
      polygon[i + 0] = polygon[0];
      polygon[i + 1] = polygon[1];

      var x = 0, y = 100;
      setInterval(function () {

        x += 1;
        a.clearRect(0, 0, 1024, 1024);
        var s = Date.now();
        for (var i = 0; i < 10000; i++) {
          var r = Shumway.GeometricUtilities.pointInPolygon(x, y, polygon);
        }
        aResults.innerHTML = "Query Time: " + ((Date.now() - s) / 10000) + " ms";
        if (r) {
          a.fillStyle = "green";
        } else {
          a.fillStyle = "white";
        }
        strokeOrFillPolygon(a, polygon, false);
        strokeOrFillPolygon(a, polygon, true);
        a.fillStyle = "white";
        a.fillRect(x - 2, y - 2, 4, 4);

      }, 16);
    }

    function getPolygonBounds(polygon) {
      var n = polygon.length;
      var p = polygon;
      var minX = p[0], minY = p[1];
      var maxX = p[0], maxY = p[1];

      for (var i = 0; i < n; i += 2) {
        var px = p[i + 0];
        var py = p[i + 1];
        if (px < minX) { minX = px; }
        if (py < minY) { minY = py; }
        if (px > maxX) { maxX = px; }
        if (py > maxY) { maxY = py; }
      }
      return new Rectangle(minX, minY, maxX - minX, maxY - minY);
    }

    function testF() {
      var paths = [
        [[643.45, 144.75], [643.75, 146.3], [644, 150.2], [644.05, 156.5, 641.9, 160.8], [639, 166.85, 632, 168], [623.3, 169.4, 608.85, 163.1], [605.9, 161.85, 602.65, 161.2], [598.5, 160.45, 595.2, 161.15], [586.35, 162.95, 585.85, 174.3], [585.7, 177.35, 587.55, 182.7], [589.45, 188.15, 592.4, 193.15], [595.65, 198.65, 599, 201.45], [602.9, 204.65, 606.15, 203.55], [609.35, 202.45, 612.35, 198.35], [614.35, 195.6, 617.15, 189.9], [620.55, 183.1, 621.7, 181.15], [624.4, 176.8, 627, 175.25], [628.5, 174.4, 629.95, 174.7], [631.4, 175.1, 632.55, 176.4], [635.1, 179.25, 635.05, 184.5], [635, 190.45, 631.35, 196.15], [627, 203.1, 618.2, 208.15], [613.65, 210.8, 612, 213.85], [610.45, 216.65, 611.4, 219.5], [612.25, 222.2, 615.05, 224.5], [617.75, 226.8, 621.65, 228.25], [625.55, 229.7, 629.75, 229.95], [634.2, 230.2, 638, 229], [647.05, 226.2, 649.65, 216.55], [652.05, 207.35, 654.85, 207.55], [655.95, 207.55, 657.3, 209.05], [659.8, 212.2], [662.35, 215.15], [663.7, 216.35, 665, 216], [668, 215.15, 670.95, 204.25], [673.95, 193.05, 670.3, 181.2], [667.45, 171.75, 660.5, 162.3], [655.5, 155.55, 649, 149.5], [645.05, 146], [643.45, 144.75]],
        [[159.6, 370.1], [193.3, 345.2, 208.75, 322.45], [204.75, 321.6, 200.85, 320.15], [192.9, 317.15, 187.35, 312.55], [181.55, 307.75, 179.8, 302.25], [178.05, 296.9, 180.5, 291.7], [175.9, 293.55], [171, 295.35, 166.5, 296.15], [159.3, 297.35, 153.05, 296], [142.05, 293.65, 135.95, 283.6], [135.9, 283.55], [123.85, 280.3, 117.25, 276.1], [112.5, 273.05, 108.6, 269.85], [119.75, 287, 124.4, 297.45], [131.95, 314.4, 129.55, 326.8], [127.1, 339.3, 109.65, 345.75], [100.5, 349.15, 88.2, 350.6], [87.6, 350.9], [78.25, 356.3, 74.8, 362.55], [71.65, 368.3, 73.6, 374.25], [75.35, 379.8, 81.15, 384.6], [86.7, 389.25, 94.65, 392.2], [101, 394.55, 107.7, 395.4], [102.75, 397.25], [94.9, 399.75, 85.8, 399.2], [77.2, 398.7, 69.1, 395.7], [61.15, 392.7, 55.6, 388.1], [49.8, 383.3, 48.05, 377.8], [46.3, 372.45, 48.75, 367.25], [44.15, 369.1], [31.5, 373.75, 21.3, 371.55], [10.3, 369.2, 4.2, 359.15], [-0.9, 350.7, -2.1, 337.4], [-36.7, 314.9, -26.25, 283.5], [-22.3, 271.7, -12.3, 259.9], [-4.35, 250.45, 5.2, 243.45], [52.05, 208.85, 63.55, 178.4], [72.7, 154, 58.95, 133.4], [49.15, 118.65, 28.85, 107.25], [22.5, 103.7, 15.85, 100.9], [10.5, 98.8], [17.25, 96.15], [26, 92.85, 35.75, 89.85], [67.2, 80.25, 98, 76.8], [141.05, 72, 176.7, 80.25], [183, 81.85], [181, 76.65, 177.7, 71.7], [167.9, 56.95, 147.6, 45.55], [141.25, 42, 134.6, 39.2], [129.25, 37.1], [136, 34.45], [144.75, 31.15, 154.5, 28.15], [185.95, 18.55, 216.75, 15.1], [259.8, 10.3, 295.45, 18.55], [339.95, 28.85, 370.2, 59.1], [387.35, 76.25, 393.55, 87.3], [398, 95.15, 396.8, 99.9], [396.1, 102.6, 393.55, 104.55], [391.75, 105.85, 389.1, 106.8], [384.7, 108.35, 375.1, 109.5], [363.75, 110.8, 360.45, 111.55], [353.15, 113.2, 350.95, 116.6], [346.2, 123.9, 363.2, 142.75], [371.15, 141.75], [414.2, 136.95, 449.85, 145.2], [494.35, 155.5, 524.6, 185.75], [526.55, 187.7], [539.4, 190.2], [545.7, 191.8], [543.7, 186.6, 540.4, 181.65], [530.6, 166.9, 510.3, 155.5], [503.95, 151.95, 497.3, 149.15], [491.95, 147.05], [498.7, 144.4], [507.45, 141.1, 517.2, 138.1], [548.65, 128.5, 579.45, 125.05], [622.5, 120.25, 658.15, 128.5], [702.65, 138.8, 732.9, 169.05], [750.05, 186.2, 756.25, 197.25], [760.7, 205.1, 759.5, 209.85], [758.8, 212.55, 756.25, 214.5], [754.45, 215.8, 751.8, 216.75], [747.4, 218.3, 737.8, 219.45], [723.15, 221.5], [715.85, 223.15, 713.65, 226.55], [708.05, 235.2, 732.9, 260.05], [758.9, 286.05, 751.25, 320.15], [748.05, 334.6, 739, 348.35], [737, 351.3], [734.3, 352, 731.3, 353], [705.35, 362], [689.4, 367.2, 679.4, 367.8], [647.35, 369.65, 638.95, 372.6], [635.2, 373.95, 633.25, 376.25], [629.9, 381.3], [626.6, 386.3, 618.35, 393.35], [610.85, 399.8, 609.65, 399.8], [608.4, 399.8, 606.15, 398.55], [603.9, 397.3, 602.65, 397.3], [594.75, 397.3, 578.45, 423.8], [573.2, 432.75], [568.3, 431.85, 563.55, 430.1], [555.6, 427.1, 550.05, 422.5], [544.4, 417.8, 542.6, 412.5], [538.15, 413.9, 529.25, 414.95], [514.6, 417], [507.3, 418.65, 505.1, 422.05], [499.5, 430.7, 524.35, 455.55], [550.35, 481.55, 542.7, 515.65], [541.85, 519.15], [550.35, 518.05], [593.4, 513.25, 629.05, 521.5], [635.35, 523.1], [633.35, 517.9, 630.05, 512.95], [620.25, 498.2, 599.95, 486.8], [593.6, 483.25, 586.95, 480.45], [581.6, 478.35], [588.35, 475.7], [597.1, 472.4, 606.85, 469.4], [638.3, 459.8, 669.1, 456.35], [712.15, 451.55, 747.8, 459.8], [792.3, 470.1, 822.55, 500.35], [839.7, 517.5, 845.9, 528.55], [850.35, 536.4, 849.15, 541.15], [848.45, 543.85, 845.9, 545.8], [844.1, 547.1, 841.45, 548.05], [837.05, 549.6, 827.45, 550.75], [816.1, 552.05, 812.8, 552.8], [805.5, 554.45, 803.3, 557.85], [797.7, 566.5, 822.55, 591.35], [848.55, 617.35, 840.9, 651.45], [837.7, 665.9, 828.65, 679.65], [826.65, 682.6], [820.95, 684.3], [804, 690.35, 795, 693.3], [779.05, 698.5, 769.05, 699.1], [737, 700.95, 728.6, 703.9], [724.85, 705.25, 722.9, 707.55], [719.55, 712.6], [716.25, 717.6, 708, 724.65], [700.5, 731.1, 699.3, 731.1], [698.05, 731.1, 695.8, 729.85], [693.55, 728.6, 692.3, 728.6], [684.4, 728.6, 668.1, 755.1], [662.85, 764.05], [657.95, 763.15, 653.2, 761.4], [645.25, 758.4, 639.7, 753.8], [633.9, 749, 632.15, 743.5], [630.4, 738.15, 632.85, 732.95], [628.25, 734.8], [623.35, 736.6, 618.85, 737.4], [611.65, 738.6, 605.4, 737.25], [594.4, 734.9, 588.3, 724.85], [588.25, 724.8], [576.2, 721.55, 569.6, 717.35], [564.85, 714.3, 560.95, 711.1], [572.1, 728.25, 576.75, 738.7], [584.3, 755.65, 581.9, 768.05], [579.45, 780.55, 562, 787], [552.85, 790.4, 540.55, 791.85], [539.95, 792.15], [530.6, 797.55, 527.15, 803.8], [524, 809.55, 525.95, 815.5], [527.7, 821.05, 533.5, 825.85], [539.05, 830.5, 547, 833.45], [553.35, 835.8, 560.05, 836.65], [555.1, 838.5], [547.25, 841, 538.15, 840.45], [529.55, 839.95, 521.45, 836.95], [513.5, 833.95, 507.95, 829.35], [502.15, 824.55, 500.4, 819.05], [498.65, 813.7, 501.1, 808.5], [496.5, 810.35], [483.85, 815, 473.65, 812.8], [462.65, 810.45, 456.55, 800.4], [451.45, 791.95, 450.25, 778.65], [432, 766.8, 426.3, 752.45], [418.25, 754.4, 412.35, 754.75], [380.3, 756.6, 371.9, 759.55], [368.15, 760.9, 366.2, 763.2], [362.85, 768.25], [359.55, 773.25, 351.3, 780.3], [343.8, 786.75, 342.6, 786.75], [341.35, 786.75, 339.1, 785.5], [336.85, 784.25, 335.6, 784.25], [327.7, 784.25, 311.4, 810.75], [306.15, 819.7], [301.25, 818.8, 296.5, 817.05], [288.55, 814.05, 283, 809.45], [277.2, 804.65, 275.45, 799.15], [273.7, 793.8, 276.15, 788.6], [271.55, 790.45], [266.65, 792.25, 262.15, 793.05], [254.95, 794.25, 248.7, 792.9], [237.7, 790.55, 231.6, 780.5], [231.55, 780.45], [219.5, 777.2, 212.9, 773], [208.15, 769.95, 204.25, 766.75], [215.4, 783.9, 220.05, 794.35], [227.6, 811.3, 225.2, 823.7], [222.75, 836.2, 205.3, 842.65], [196.15, 846.05, 183.85, 847.5], [183.25, 847.8], [173.9, 853.2, 170.45, 859.45], [167.3, 865.2, 169.25, 871.15], [171, 876.7, 176.8, 881.5], [182.35, 886.15, 190.3, 889.1], [196.65, 891.45, 203.35, 892.3], [198.4, 894.15], [190.55, 896.65, 181.45, 896.1], [172.85, 895.6, 164.75, 892.6], [156.8, 889.6, 151.25, 885], [145.45, 880.2, 143.7, 874.7], [141.95, 869.35, 144.4, 864.15], [139.8, 866], [127.15, 870.65, 116.95, 868.45], [105.95, 866.1, 99.85, 856.05], [94.75, 847.6, 93.55, 834.3], [58.95, 811.8, 69.4, 780.4], [73.35, 768.6, 83.35, 756.8], [91.3, 747.35, 100.85, 740.35], [147.7, 705.75, 159.2, 675.3], [160.45, 671.95, 161.3, 668.7], [159.7, 666.8, 158.35, 664.6], [153.25, 656.15, 152.05, 642.85], [126.45, 626.2, 125.55, 604.75], [124.5, 604.15], [118.15, 600.6, 111.5, 597.8], [106.15, 595.7], [112.9, 593.05], [120.25, 590.25, 128.35, 587.7], [132.4, 576.55, 141.85, 565.35], [149.8, 555.9, 159.35, 548.9], [188.35, 527.45, 203.85, 507.65], [202.95, 506.05, 202.45, 504.45], [200.7, 499.1, 203.15, 493.9], [198.55, 495.75], [185.9, 500.4, 175.7, 498.2], [164.7, 495.85, 158.6, 485.8], [153.5, 477.35, 152.3, 464.05], [117.7, 441.55, 128.15, 410.15], [132.1, 398.35, 142.1, 386.55], [150.05, 377.1, 159.6, 370.1]],
        [[756.8, 675.7], [756.8, 669.15, 748.85, 664.8], [741.7, 660.9, 731.3, 660.2], [721, 659.5, 713.75, 662.35], [705.8, 665.5, 705.8, 671.7], [705.8, 676.25, 713.85, 682.6], [722.6, 689.6, 731.3, 689.6], [734.8, 689.6, 737.55, 687.75], [740.8, 685.6], [756.8, 688.6, 756.8, 675.7]],
        [[820.8, 653.85], [820.8, 651.95, 820.25, 648.65], [823.8, 642.65, 823.8, 639.2], [823.8, 629.15, 813.8, 616.35], [804.4, 604.25, 791.8, 596.65], [778.45, 588.6, 769.8, 590.9], [760.5, 593.3, 759.85, 607.55], [758.8, 612.6], [757.15, 620.85, 754.6, 629.9], [753.8, 632.6, 753.8, 641.1], [753.9, 647.35], [754.5, 654.25, 757.3, 659.85], [766.1, 677.6, 793.3, 677.6], [803.8, 677.6, 813.05, 667.35], [816.45, 663.55, 818.75, 659.4], [820.8, 655.65, 820.8, 653.85]],
        [[671.8, 572.6], [663.55, 572.6, 655.7, 586.35], [652.75, 591.5, 650.75, 597.1], [648.95, 602.25, 648.95, 604.7], [648.95, 607.15, 650.45, 610.35], [652.9, 615.6, 657.95, 615.6], [664.45, 615.6, 674.55, 603.35], [678.3, 598.8, 681.15, 594.25], [683.8, 589.95, 683.8, 588.7], [683.8, 582.9, 682.85, 580.1], [680.25, 572.6, 671.8, 572.6]],
        [[733.1, 476.05], [733.4, 477.6], [733.65, 481.5], [733.7, 487.8, 731.55, 492.1], [728.65, 498.15, 721.65, 499.3], [712.95, 500.7, 698.5, 494.4], [695.55, 493.15, 692.3, 492.5], [688.15, 491.75, 684.85, 492.45], [676, 494.25, 675.5, 505.6], [675.35, 508.65, 677.2, 514], [679.1, 519.45, 682.05, 524.45], [685.3, 529.95, 688.65, 532.75], [692.55, 535.95, 695.8, 534.85], [699, 533.75, 702, 529.65], [704, 526.9, 706.8, 521.2], [710.2, 514.4, 711.35, 512.45], [714.05, 508.1, 716.65, 506.55], [718.15, 505.7, 719.6, 506], [721.05, 506.4, 722.2, 507.7], [724.75, 510.55, 724.7, 515.8], [724.65, 521.75, 721, 527.45], [716.65, 534.4, 707.85, 539.45], [703.3, 542.1, 701.65, 545.15], [700.1, 547.95, 701.05, 550.8], [701.9, 553.5, 704.7, 555.8], [707.4, 558.1, 711.3, 559.55], [715.2, 561, 719.4, 561.25], [723.85, 561.5, 727.65, 560.3], [736.7, 557.5, 739.3, 547.85], [741.7, 538.65, 744.5, 538.85], [745.6, 538.85, 746.95, 540.35], [749.45, 543.5], [752, 546.45], [753.35, 547.65, 754.65, 547.3], [757.65, 546.45, 760.6, 535.55], [763.6, 524.35, 759.95, 512.5], [757.1, 503.05, 750.15, 493.6], [745.15, 486.85, 738.65, 480.8], [734.7, 477.3], [733.1, 476.05]],
        [[667.15, 344.4], [667.15, 337.85, 659.2, 333.5], [652.05, 329.6, 641.65, 328.9], [631.35, 328.2, 624.1, 331.05], [616.15, 334.2, 616.15, 340.4], [616.15, 344.95, 624.2, 351.3], [632.95, 358.3, 641.65, 358.3], [645.15, 358.3, 647.9, 356.45], [651.15, 354.3], [667.15, 357.3, 667.15, 344.4]],
        [[731.15, 322.55], [731.15, 320.65, 730.6, 317.35], [734.15, 311.35, 734.15, 307.9], [734.15, 297.85, 724.15, 285.05], [714.75, 272.95, 702.15, 265.35], [688.8, 257.3, 680.15, 259.6], [670.85, 262, 670.2, 276.25], [669.15, 281.3], [667.5, 289.55, 664.95, 298.6], [664.15, 301.3, 664.15, 309.8], [664.25, 316.05], [664.85, 322.95, 667.65, 328.55], [676.45, 346.3, 703.65, 346.3], [714.15, 346.3, 723.4, 336.05], [726.8, 332.25, 729.1, 328.1], [731.15, 324.35, 731.15, 322.55]],
        [[708.7, 612.45], [694.05, 614.5], [686.75, 616.15, 684.55, 619.55], [679.9, 626.75, 696.25, 645.05], [734.85, 645.05], [731.4, 626.95, 723.7, 612.1], [722.5, 609.85], [718.05, 611.35, 708.7, 612.45]],
        [[435.15, 161.45], [435.45, 163], [435.7, 166.9], [435.75, 173.2, 433.6, 177.5], [430.7, 183.55, 423.7, 184.7], [415, 186.1, 400.55, 179.8], [397.6, 178.55, 394.35, 177.9], [387.65, 177.7], [391.35, 189.5, 389.85, 202.6], [394.05, 201.15, 398.45, 199.8], [406.9, 197.2, 415.35, 195.1], [417.05, 192.95, 418.7, 191.95], [420.2, 191.1, 421.65, 191.4], [423, 191.8, 424.15, 192.95], [440.85, 189.15, 457.45, 187.15], [455.2, 183.05, 452.2, 179], [447.2, 172.25, 440.7, 166.2], [436.75, 162.7], [435.15, 161.45]],
        [[667.8, 713.1], [667.8, 705.05, 662.95, 684.25], [658.6, 665.65, 656.2, 659.85], [654.25, 655.15, 649.5, 651.3], [644.85, 647.5, 639.25, 646.05], [633.3, 644.5, 628.35, 646.25], [622.8, 648.25, 619.7, 654.1], [618.95, 655.5, 618.75, 657.15], [618.5, 659.9], [618, 663.2, 613.7, 666.85], [608.95, 670.75, 608.95, 680.35], [608.95, 682.05, 610.9, 688.65], [613.65, 698.05, 618, 705.9], [631.6, 730.6, 654.95, 730.6], [664.6, 730.6, 667.1, 722.9], [667.8, 720.7, 667.8, 713.1]],
        [[413.35, 244.95], [417.25, 246.4, 421.45, 246.65], [423.7, 246.7], [421.65, 243.35], [415.9, 234.7, 406.55, 227.2], [404.65, 228.8, 403.7, 230.55], [402.15, 233.35, 403.1, 236.2], [403.95, 238.9, 406.75, 241.2], [409.45, 243.5, 413.35, 244.95]],
        [[387.8, 215.2], [390.7, 218.15], [394.1, 220.95, 397.05, 220.45], [391.55, 217.2], [387.8, 215.2]],
        [[331.1, 206.9], [337.4, 208.5], [335.4, 203.3, 332.1, 198.35], [323.25, 185, 305.8, 174.45], [304.35, 181.25, 302.25, 188.65], [301.45, 191.35, 301.45, 199.85], [301.5, 202.4], [316.9, 203.6, 331.1, 206.9]],
        [[373.85, 258], [365.6, 258, 357.75, 271.75], [354.8, 276.9, 352.8, 282.5], [351, 287.65, 351, 290.1], [351, 292.55, 352.5, 295.75], [354.95, 301, 360, 301], [366.5, 301, 376.6, 288.75], [380.35, 284.2, 383.2, 279.65], [385.85, 275.35, 385.85, 274.1], [385.85, 268.3, 384.9, 265.5], [382.3, 258, 373.85, 258]],
        [[410.75, 297.85], [399.4, 299.15, 396.1, 299.9], [388.8, 301.55, 386.6, 304.95], [383.55, 309.65, 389.5, 319.1], [398.3, 318.65, 406.8, 318.85], [417.25, 307, 423, 295.75], [418.6, 296.95, 410.75, 297.85]],
        [[311, 365.75], [311, 367.45, 312.95, 374.05], [314.3, 378.65, 316.05, 382.9], [330.85, 385.7], [337.15, 387.3], [335.15, 382.1, 331.85, 377.15], [324.75, 366.5, 312.2, 357.6], [311, 360.95, 311, 365.75]],
        [[460.15, 301.5], [456.65, 315.3], [455.9, 317.85, 455.85, 325.6], [457.5, 326.05], [461.6, 317.1, 469.15, 308.15], [473.15, 303.65], [466.4, 301.4, 460.15, 301.5]],
        [[582.15, 241.3], [573.9, 241.3, 566.05, 255.05], [563.1, 260.2, 561.1, 265.8], [559.3, 270.95, 559.3, 273.4], [559.3, 275.85, 560.8, 279.05], [563.25, 284.3, 568.3, 284.3], [574.8, 284.3, 584.9, 272.05], [588.65, 267.5, 591.5, 262.95], [594.15, 258.65, 594.15, 257.4], [594.15, 251.6, 593.2, 248.8], [590.6, 241.3, 582.15, 241.3]],
        [[410.05, 410.05], [403.1, 415.65], [404.05, 417.95, 406.5, 420], [409.2, 422.3, 413.1, 423.75], [417, 425.2, 421.2, 425.45], [425.65, 425.7, 429.45, 424.5], [437.65, 421.95, 440.55, 413.85], [439.15, 405.1, 435.2, 396.7], [433.55, 393.2, 431.1, 389.15], [430.65, 389.3], [426.9, 390.65, 424.95, 392.95], [421.6, 398], [418.3, 403, 410.05, 410.05]],
        [[619.05, 281.15], [607.7, 282.45, 604.4, 283.2], [597.1, 284.85, 594.9, 288.25], [590.25, 295.45, 606.6, 313.75], [645.2, 313.75], [641.75, 295.65, 634.05, 280.8], [632.85, 278.55], [628.4, 280.05, 619.05, 281.15]],
        [[529.5, 236.15], [514.85, 238.2], [514.05, 238.4], [516.35, 241.2, 516.3, 246.2], [516.25, 252.15, 512.6, 257.85], [510.55, 260.8], [515.8, 267.35], [533.6, 250.1, 541.8, 234], [537.4, 235.2, 529.5, 236.15]],
        [[219.45, 131.35], [211.2, 131.35, 203.35, 145.1], [200.4, 150.25, 198.4, 155.85], [196.6, 161, 196.6, 163.45], [196.6, 165.9, 198.1, 169.1], [200.55, 174.35, 205.6, 174.35], [212.1, 174.35, 222.2, 162.1], [225.95, 157.55, 228.8, 153], [231.45, 148.7, 231.45, 147.45], [231.45, 141.65, 230.5, 138.85], [227.9, 131.35, 219.45, 131.35]],
        [[162, 96.5], [162.3, 98.05], [162.55, 101.95], [162.6, 108.25, 160.45, 112.55], [157.55, 118.6, 150.55, 119.75], [141.85, 121.15, 127.4, 114.85], [124.45, 113.6, 121.2, 112.95], [117.05, 112.2, 113.75, 112.9], [104.9, 114.7, 104.4, 126.05], [104.25, 129.1, 106.1, 134.45], [108, 139.9, 110.95, 144.9], [114.2, 150.4, 117.55, 153.2], [121.45, 156.4, 124.7, 155.3], [127.9, 154.2, 130.9, 150.1], [132.9, 147.35, 135.7, 141.65], [140.25, 132.9], [142.95, 128.55, 145.55, 127], [147.05, 126.15, 148.5, 126.45], [149.95, 126.85, 151.1, 128.15], [153.65, 131, 153.6, 136.25], [153.55, 142.2, 149.9, 147.9], [145.55, 154.85, 136.75, 159.9], [132.2, 162.55, 130.55, 165.6], [129, 168.4, 129.95, 171.25], [130.6, 173.35, 132.5, 175.25], [170.95, 145, 181.8, 118.05], [179.05, 114.05], [174.05, 107.3, 167.55, 101.25], [163.6, 97.75], [162, 96.5]],
        [[280.75, 34.8], [281.05, 36.35], [281.3, 40.25], [281.35, 46.55, 279.2, 50.85], [276.3, 56.9, 269.3, 58.05], [260.6, 59.45, 246.15, 53.15], [243.2, 51.9, 239.95, 51.25], [235.8, 50.5, 232.5, 51.2], [223.65, 53, 223.15, 64.35], [223, 67.4, 224.85, 72.75], [226.75, 78.2, 229.7, 83.2], [232.95, 88.7, 236.3, 91.5], [240.2, 94.7, 243.45, 93.6], [246.65, 92.5, 249.65, 88.4], [251.65, 85.65, 254.45, 79.95], [257.85, 73.15, 259, 71.2], [261.7, 66.85, 264.3, 65.3], [265.8, 64.45, 267.25, 64.75], [268.7, 65.15, 269.85, 66.45], [272.4, 69.3, 272.35, 74.55], [272.3, 80.5, 268.65, 86.2], [264.3, 93.15, 255.5, 98.2], [250.95, 100.85, 249.3, 103.9], [247.75, 106.7, 248.7, 109.55], [249.55, 112.25, 252.35, 114.55], [255.05, 116.85, 258.95, 118.3], [262.85, 119.75, 267.05, 120], [271.5, 120.25, 275.3, 119.05], [284.35, 116.25, 286.95, 106.6], [289.35, 97.4, 292.15, 97.6], [293.25, 97.6, 294.6, 99.1], [297.1, 102.25], [299.65, 105.2], [301, 106.4, 302.3, 106.05], [305.3, 105.2, 308.25, 94.3], [311.25, 83.1, 307.6, 71.25], [304.75, 61.8, 297.8, 52.35], [292.8, 45.6, 286.3, 39.55], [282.35, 36.05], [280.75, 34.8]],
        [[522.85, 339.25], [522.7, 336.9], [519.7, 340.45, 519.35, 347.25], [520.8, 344.8], [522.85, 341.05, 522.85, 339.25]],
        [[530.7, 365.05], [528.7, 368], [527.95, 368.2], [542.15, 382.9, 547.7, 392.75], [549.35, 395.9], [556.65, 399.3, 565.3, 399.3], [574.95, 399.3, 577.45, 391.6], [578.15, 389.4, 578.15, 381.8], [578.15, 373.75, 573.3, 352.95], [568.95, 334.35, 566.55, 328.55], [564.6, 323.85, 559.85, 320], [555.2, 316.2, 549.6, 314.75], [544.2, 314.05], [545.6, 324.95, 542.95, 336.85], [539.75, 351.3, 530.7, 365.05]],
        [[493.85, 282.05], [492.7, 281.4], [493.4, 283.4, 495.2, 285.2], [496.8, 283.95], [493.85, 282.05]],
        [[252.4, 203.45], [282.1, 201.7], [278.6, 184.85, 271.35, 170.85], [270.15, 168.6], [265.7, 170.1, 256.35, 171.2], [241.7, 173.25], [234.4, 174.9, 232.2, 178.3], [227.55, 185.5, 243.9, 203.8], [249.4, 203.8], [252.4, 203.45]],
        [[317.45, 149.65], [313.25, 150.75, 310.85, 154.25], [318.85, 151.8, 326.85, 149.85], [321.6, 148.55, 317.45, 149.65]],
        [[77.55, 207.8], [77.55, 218.95, 86.65, 235.55], [90.6, 242.25], [88.95, 232.55, 92.5, 221.8], [96.45, 210, 106.45, 198.2], [110.45, 193.7], [100.4, 190.35, 91.45, 192.15], [85.05, 193.45, 81.35, 197.45], [77.55, 201.55, 77.55, 207.8]],
        [[78.6, 313.35], [78.6, 299.7, 72.5, 286.75], [67.2, 275.6, 54.35, 259.35], [44.2, 251, 30.2, 254.4], [24.25, 255.9, 20, 259.2], [16.35, 262.1, 15.05, 265.5], [13.25, 267, 11.8, 269.2], [7.6, 275.6, 7.6, 285.7], [7.45, 287.8], [7.45, 289.3, 7.75, 290.65], [7.6, 291.95, 7.6, 293.45], [7.6, 306.3, 18.35, 317.9], [30.8, 331.35, 49.6, 331.35], [69.8, 331.35, 75.65, 325.4], [77.85, 323.1, 78.4, 319.6], [78.6, 318.2, 78.6, 313.35]],
        [[171.65, 222.8], [180.4, 219.5, 190.15, 216.5], [200.7, 213.45], [197.15, 210.05], [192.5, 206.25, 186.9, 204.8], [180.95, 203.25, 176, 205], [170.45, 207, 167.35, 212.85], [166.6, 214.25, 166.4, 215.9], [166.15, 218.65], [165.65, 221.95, 161.35, 225.6], [156.6, 229.5, 156.6, 239.1], [156.6, 240.8, 158.55, 247.4], [161.3, 256.8, 165.65, 264.65], [179.25, 289.35, 202.6, 289.35], [212.25, 289.35, 214.75, 281.65], [215.45, 279.45, 215.45, 271.85], [215.45, 268.15, 214.45, 261.7], [213.35, 260.05], [203.55, 245.3, 183.25, 233.9], [176.9, 230.35, 170.25, 227.55], [164.9, 225.45], [171.65, 222.8]],
        [[70.8, 351.6], [49.4, 351.8, 28.5, 347.8], [20.25, 346], [25.2, 349.65, 31.85, 352.15], [39.95, 355.15, 48.55, 355.65], [57.65, 356.2, 65.5, 353.7], [68.35, 352.8, 70.9, 351.6], [70.8, 351.6]],
        [[316.4, 223.15], [316.7, 224.7], [316.95, 228.6], [316.9, 231.15], [322.15, 234.1, 329.2, 235.4], [325.85, 231.5, 321.95, 227.9], [318, 224.4], [316.4, 223.15]],
        [[268.15, 239.55], [264.8, 240.25, 262.7, 242.25], [270.85, 248.35, 278.95, 248.35], [282.45, 248.35, 285.2, 246.5], [288.45, 244.35], [290.05, 244.65], [286.2, 243.4, 281.8, 241.5], [278.85, 240.25, 275.6, 239.6], [271.45, 238.85, 268.15, 239.55]],
        [[290.1, 268.3], [293.5, 261.5, 294.65, 259.55], [294.7, 259.55], [281.25, 260.9, 276.25, 262.65], [272.5, 264, 270.55, 266.3], [267.2, 271.35], [266.15, 272.85], [269, 277.4, 271.95, 279.85], [275.85, 283.05, 279.1, 281.95], [282.3, 280.85, 285.3, 276.75], [287.3, 274, 290.1, 268.3]],
        [[284.95, 292.25], [283.4, 295.05, 284.35, 297.9], [285, 300, 286.9, 301.9], [317.75, 277.65, 330.85, 255.5], [322.7, 257.5, 316.7, 257.85], [307.45, 258.45], [308, 260.4, 308, 262.9], [307.95, 268.85, 304.3, 274.55], [299.95, 281.5, 291.15, 286.55], [286.6, 289.2, 284.95, 292.25]],
        [[231.95, 334.45], [231.95, 345.6, 241.05, 362.2], [245, 368.9], [243.35, 359.2, 246.9, 348.45], [250.85, 336.65, 260.85, 324.85], [264.85, 320.35], [254.8, 317, 245.85, 318.8], [239.45, 320.1, 235.75, 324.1], [231.95, 328.2, 231.95, 334.45]],
        [[249.05, 518.85], [250.05, 519.2], [254, 511.45, 260.6, 503.65], [264.6, 499.15], [254.55, 495.8, 245.6, 497.6], [239.2, 498.9, 235.5, 502.9], [233.35, 505.25, 232.4, 508.3], [235.55, 511.25], [241.1, 515.9, 249.05, 518.85]],
        [[174.65, 472.65], [179.6, 476.3, 186.25, 478.8], [194.35, 481.8, 202.95, 482.3], [211.4, 482.8, 218.8, 480.7], [219.55, 478.25], [201, 477.9, 182.9, 474.45], [174.65, 472.65]],
        [[282.05, 458.9], [283.55, 457.6, 285.05, 455.55], [287.05, 452.8, 289.85, 447.1], [293.25, 440.3, 294.4, 438.35], [297.1, 434, 299.7, 432.45], [301.2, 431.6, 302.65, 431.9], [304.1, 432.3, 305.25, 433.6], [307.8, 436.45, 307.75, 441.7], [307.7, 447.65, 304.05, 453.35], [299.7, 460.3, 290.9, 465.35], [286.35, 468, 284.7, 471.05], [283.15, 473.85, 284.1, 476.7], [284.75, 478.8, 286.65, 480.7], [321.9, 453, 333.95, 428.05], [332.95, 424.3, 334.05, 420.65], [333.2, 419.5], [332.95, 419.2], [330.3, 420.2], [325.4, 422, 320.9, 422.8], [310.25, 423.15], [307.9, 424.65, 304.7, 425.2], [296, 426.6, 281.55, 420.3], [278.95, 419.2, 276.15, 418.6], [278.8, 424.1], [286.35, 441.05, 283.95, 453.45], [283.4, 456.3, 282.05, 458.9]],
        [[204, 458], [214.05, 458, 220.55, 456.55], [218.8, 447.35, 213.1, 438.85], [203.3, 424.1, 183, 412.7], [176.65, 409.15, 170, 406.35], [164.65, 404.25], [171.4, 401.6], [180.15, 398.3, 189.9, 395.3], [200.7, 392, 211.45, 389.45], [208.75, 386], [198.6, 377.65, 184.6, 381.05], [178.65, 382.55, 174.4, 385.85], [170.75, 388.75, 169.45, 392.15], [167.65, 393.65, 166.2, 395.85], [162, 402.25, 162, 412.35], [161.85, 414.45], [161.85, 415.95, 162.15, 417.3], [162, 418.6, 162, 420.1], [162, 432.95, 172.75, 444.55], [185.2, 458, 204, 458]],
        [[240.2, 525.85], [233.8, 525.15], [235.5, 529.95], [241.1, 527.9, 247.1, 526], [247.15, 525.8], [243.75, 526.05, 240.2, 525.85]],
        [[169.2, 570.95], [167.4, 572.45, 165.95, 574.65], [164.8, 576.4, 164, 578.45], [178.9, 575.35, 193.65, 573.7], [214.1, 572.15], [208.5, 564.8], [198.35, 556.45, 184.35, 559.85], [178.4, 561.35, 174.15, 564.65], [170.5, 567.55, 169.2, 570.95]],
        [[244.75, 547.7], [244.35, 545.4, 244.25, 543.05], [243.25, 542.45], [240.9, 541.15], [244.75, 547.7]],
        [[232.75, 618.8], [232.65, 615.3], [228.2, 614, 223.05, 611.75], [220.1, 610.5, 216.85, 609.85], [212.7, 609.1, 209.4, 609.8], [200.55, 611.6, 200.05, 622.95], [199.9, 626, 201.75, 631.35], [202.7, 634.15, 204, 636.8], [224, 636.75, 229.8, 630.85], [232, 628.55, 232.55, 625.05], [232.75, 623.65, 232.75, 618.8]],
        [[315.1, 628.25], [306.85, 628.25, 299, 642], [296.05, 647.15, 294.05, 652.75], [292.25, 657.9, 292.25, 660.35], [292.25, 662.8, 293.75, 666], [296.2, 671.25, 301.25, 671.25], [307.75, 671.25, 317.85, 659], [321.6, 654.45, 324.45, 649.9], [327.1, 645.6, 327.1, 644.35], [327.1, 638.55, 326.15, 635.75], [323.55, 628.25, 315.1, 628.25]],
        [[174.25, 810.25], [174.25, 796.6, 168.15, 783.65], [162.85, 772.5, 150, 756.25], [139.85, 747.9, 125.85, 751.3], [119.9, 752.8, 115.65, 756.1], [112, 759, 110.7, 762.4], [108.9, 763.9, 107.45, 766.1], [103.25, 772.5, 103.25, 782.6], [103.1, 784.7], [103.1, 786.2, 103.4, 787.55], [103.25, 788.85, 103.25, 790.35], [103.25, 803.2, 114, 814.8], [126.45, 828.25, 145.25, 828.25], [165.45, 828.25, 171.3, 822.3], [173.5, 820, 174.05, 816.5], [174.25, 815.1, 174.25, 810.25]],
        [[369.6, 577.3], [369.6, 570.5, 366.15, 554.7], [364.95, 554.95], [356.25, 556.35, 341.8, 550.05], [338.85, 548.8, 335.6, 548.15], [331.45, 547.4, 328.15, 548.1], [319.3, 549.9, 318.8, 561.25], [318.65, 564.3, 320.5, 569.65], [321.35, 572.15, 322.5, 574.6], [329.6, 585.5, 339.05, 590.55], [339.1, 590.5], [342.3, 589.4, 345.3, 585.3], [347.3, 582.55, 350.1, 576.85], [353.5, 570.05, 354.65, 568.1], [357.35, 563.75, 359.95, 562.2], [361.45, 561.35, 362.9, 561.65], [364.35, 562.05, 365.5, 563.35], [368.05, 566.2, 368, 571.45], [367.95, 577.4, 364.3, 583.1], [360.2, 589.65, 352.1, 594.55], [356.75, 594.8], [366.4, 594.8, 368.9, 587.1], [369.6, 584.9, 369.6, 577.3]],
        [[242.35, 656.05], [241.75, 656.35], [232.4, 661.75, 228.95, 668], [228, 669.75, 227.55, 671.5], [228.15, 672.15], [239, 663.6, 247.7, 655.3], [242.35, 656.05]],
        [[173.2, 704.7], [173.2, 715.85, 182.3, 732.45], [186.25, 739.15], [184.6, 729.45, 188.15, 718.7], [192.1, 706.9, 202.1, 695.1], [206.1, 690.6], [196.05, 687.25, 187.1, 689.05], [180.7, 690.35, 177, 694.35], [173.2, 698.45, 173.2, 704.7]],
        [[311.1, 768.75], [311.1, 760.7, 306.25, 739.9], [301.9, 721.3, 299.5, 715.5], [297.55, 710.8, 292.8, 706.95], [288.15, 703.15, 282.55, 701.7], [276.6, 700.15, 271.65, 701.9], [266.1, 703.9, 263, 709.75], [262.25, 711.15, 262.05, 712.8], [261.8, 715.55], [261.3, 718.85, 257, 722.5], [252.25, 726.4, 252.25, 736], [252.25, 737.7, 254.2, 744.3], [256.95, 753.7, 261.3, 761.55], [274.9, 786.25, 298.25, 786.25], [307.9, 786.25, 310.4, 778.55], [311.1, 776.35, 311.1, 768.75]],
        [[611.25, 463.75], [610.35, 460.2, 611.25, 456.8], [611.25, 463.75]],
        [[522.6, 518.05], [522.6, 516.15, 522.05, 512.85], [525.6, 506.85, 525.6, 503.4], [525.6, 493.35, 515.6, 480.55], [506.2, 468.45, 493.6, 460.85], [482.85, 454.35, 475.15, 454.6], [472.35, 455.7], [467, 457.45], [462.1, 461.6, 461.65, 471.75], [460.6, 476.8], [458.95, 485.05, 456.4, 494.1], [455.8, 496.15, 455.65, 501.5], [457.35, 502.15], [463.7, 504.5, 470.4, 505.35], [465.45, 507.2], [460.8, 508.7, 455.65, 509.1], [455.7, 511.55], [456.3, 518.45, 459.1, 524.05], [463.2, 532.35, 471.35, 536.75], [479.3, 533.8, 488.1, 531.1], [504.65, 526.05, 521.05, 522.7], [522.6, 519.65, 522.6, 518.05]],
        [[515.9, 619.65], [525.05, 595.25, 511.3, 574.65], [505.35, 565.65, 495.5, 557.95], [481.9, 562.25, 472.8, 563.15], [484.35, 575.55, 489.2, 584.2], [493.65, 592.05, 492.45, 596.8], [491.75, 599.5, 489.2, 601.45], [487.4, 602.75, 484.75, 603.7], [480.35, 605.25, 470.75, 606.4], [456.1, 608.45], [448.8, 610.1, 446.6, 613.5], [441, 622.15, 465.85, 647], [475.1, 656.25, 480.1, 666.5], [507.5, 641.95, 515.9, 619.65]],
        [[614.35, 537.75], [614.65, 539.3], [614.9, 543.2], [614.95, 549.5, 612.8, 553.8], [609.9, 559.85, 602.9, 561], [594.2, 562.4, 579.75, 556.1], [576.8, 554.85, 573.55, 554.2], [569.4, 553.45, 566.1, 554.15], [557.25, 555.95, 556.75, 567.3], [556.6, 570.35, 558.45, 575.7], [560.35, 581.15, 563.3, 586.15], [566.55, 591.65, 569.9, 594.45], [573.8, 597.65, 577.05, 596.55], [580.25, 595.45, 583.25, 591.35], [585.25, 588.6, 588.05, 582.9], [591.45, 576.1, 592.6, 574.15], [595.3, 569.8, 597.9, 568.25], [599.4, 567.4, 600.85, 567.7], [602.3, 568.1, 603.45, 569.4], [606, 572.25, 605.95, 577.5], [605.9, 583.45, 602.25, 589.15], [597.9, 596.1, 589.1, 601.15], [584.55, 603.8, 582.9, 606.85], [581.35, 609.65, 582.3, 612.5], [582.95, 614.6, 584.85, 616.5], [623.3, 586.25, 634.15, 559.3], [631.4, 555.3], [626.4, 548.55, 619.9, 542.5], [615.95, 539], [614.35, 537.75]],
        [[402.95, 480.45], [402.95, 480.35], [394.85, 482.7, 387.9, 482.1], [386.95, 482.85, 386.35, 483.75], [381.7, 490.95, 398.05, 509.25], [436.65, 509.25], [436.25, 507.1], [431.8, 505.65], [423.85, 502.65, 418.3, 498.05], [412.5, 493.25, 410.75, 487.75], [409, 482.4, 411.45, 477.2], [406.85, 479.05], [402.95, 480.35], [402.95, 480.45]],
        [[352.25, 474.55], [354.7, 479.8, 359.75, 479.8], [364.25, 479.8, 370.5, 473.9], [368.5, 471.8, 366.9, 469.1], [362.05, 461.05, 360.75, 448.55], [359, 448.05], [357.5, 450.55], [354.55, 455.7, 352.55, 461.3], [350.75, 466.45, 350.75, 468.9], [350.75, 471.35, 352.25, 474.55]],
        [[382.95, 455.95], [384, 456.7], [384.25, 456.3], [382.95, 455.95]],
        [[341.05, 510.25], [335.1, 508.7, 330.15, 510.45], [329.8, 510.6], [341.05, 510.25]],
        [[382.6, 603.5], [383.7, 599.9], [378.7, 605.5, 372.3, 615.5], [380.2, 612.4, 382.6, 603.5]],
        [[397.6, 594.05], [395.35, 592.8, 394.1, 592.8], [391.9, 592.8, 389, 594.9], [389.6, 595.25, 390.25, 596], [392.75, 599.15], [395.3, 602.1], [396.65, 603.3, 397.95, 602.95], [400.5, 602.25, 403, 594.35], [401.55, 595.3, 401.1, 595.3], [399.85, 595.3, 397.6, 594.05]],
        [[440.05, 701.15], [448, 691.7, 457.55, 684.7], [462.9, 680.7], [460.6, 676.5, 457.1, 672], [447.7, 659.9, 435.1, 652.3], [421.75, 644.25, 413.1, 646.55], [403.8, 648.95, 403.15, 663.2], [402.1, 668.25], [400.45, 676.5, 397.9, 685.55], [397.1, 688.25, 397.1, 696.75], [397.2, 703], [397.8, 709.9, 400.6, 715.5], [407.2, 728.85, 424.25, 732.15], [424.85, 728.5, 426.1, 724.75], [430.05, 712.95, 440.05, 701.15]],
        [[458.6, 539.9], [458.6, 533.35, 450.65, 529], [443.5, 525.1, 433.1, 524.4], [426.1, 523.9, 420.5, 525.1], [440.2, 533.7, 456.4, 547.3], [458.6, 544.7, 458.6, 539.9]],
        [[352, 668.1], [337.35, 670.15], [330.05, 671.8, 327.85, 675.2], [323.2, 682.4, 339.55, 700.7], [378.15, 700.7], [374.7, 682.6, 367, 667.75], [365.8, 665.5], [361.35, 667, 352, 668.1]],
        [[400.1, 731.35], [400.1, 724.8, 392.15, 720.45], [385, 716.55, 374.6, 715.85], [364.3, 715.15, 357.05, 718], [349.1, 721.15, 349.1, 727.35], [349.1, 731.9, 357.15, 738.25], [365.9, 745.25, 374.6, 745.25], [378.1, 745.25, 380.85, 743.4], [384.1, 741.25], [400.1, 744.25, 400.1, 731.35]],
        [[530.75, 760.85], [530.95, 759.45, 530.95, 754.6], [530.95, 740.95, 524.85, 728], [519.55, 716.85, 506.7, 700.6], [497.75, 693.25, 485.9, 695], [485.6, 700.9, 484.2, 707.1], [481, 721.55, 471.95, 735.3], [469.95, 738.25], [464.25, 739.95], [460.65, 741.25], [462.7, 750.55, 470.7, 759.15], [483.15, 772.6, 501.95, 772.6], [522.15, 772.6, 528, 766.65], [530.2, 764.35, 530.75, 760.85]],
        [[462.05, 715.05], [463.45, 712.5, 463.9, 710.85], [462.45, 713.15, 461.55, 715.95], [462.05, 715.05]],
        [[523.15, 792.85], [501.75, 793.05, 480.85, 789.05], [472.6, 787.25], [477.55, 790.9, 484.2, 793.4], [492.3, 796.4, 500.9, 796.9], [510, 797.45, 517.85, 794.95], [523.25, 792.85], [523.15, 792.85]],
        [[529.9, 649.05], [529.9, 660.2, 539, 676.8], [542.95, 683.5], [541.3, 673.8, 544.85, 663.05], [548.8, 651.25, 558.8, 639.45], [562.8, 634.95], [552.75, 631.6, 543.8, 633.4], [537.4, 634.7, 533.7, 638.7], [529.9, 642.8, 529.9, 649.05]],
        [[344.2, 850.7], [343.3, 847.15, 344.2, 843.75], [344.2, 850.7]],
        [[166.45, 848.5], [145.05, 848.7, 124.15, 844.7], [115.9, 842.9], [120.85, 846.55, 127.5, 849.05], [135.6, 852.05, 144.2, 852.55], [153.3, 853.1, 161.15, 850.6], [164, 849.7, 166.55, 848.5], [166.45, 848.5]],
        [[700.9, 795.05], [700, 791.5, 700.9, 788.1], [700.9, 795.05]]
      ];

      for (var i = 0; i < paths.length; i++) {
        paths[i].style = Shumway.ColorStyle.randomStyle();
      }
      var pointInPolygon = Shumway.GeometricUtilities.pointInPolygon;
      var clockwise = Shumway.GeometricUtilities.clockwise;
      var counterClockwise = Shumway.GeometricUtilities.counterClockwise;

      var polygons = [];
      var polygonBounds = [];
      for (var i = 0; i < paths.length; i++) {
        var path = paths[i];
        var points = [];
        var x0 = 0, y0 = 0;
        for (var j = 0; j < path.length; j++) {
          var command = path[j];
          if (command.length === 2) {
            var x0 = command[0], y0 = command[1];
            points.push(x0, y0);
          } else {
            var x1 = command[0], y1 = command[1];
            var x2 = command[2], y2 = command[3];
            if (counterClockwise(x0, y0, x1, y1, x2, y2)) {
              points.push(x1, y1, x2, y2);
            } else {
              points.push(x2, y2);
            }
            x0 = x2, y0 = y2;
          }
        }
        points.push(points[0]);
        points.push(points[1]);
        var polygon = new Float32Array(points);
        polygons.push(polygon);
        polygonBounds.push(getPolygonBounds(polygon));
      }

      var x = 0, y = 0;
      setInterval(function () {
        a.save();
        a.scale(1.5, 1.5);
        x += 1;
        a.clearRect(0, 0, 2048, 2048);
        var s = Date.now();

        a.beginPath();
        paths.forEach(function (p) {
          a.fillStyle = p.style;
          createPath(a, p, false);
        });
        a.closePath();
        a.fill("evenodd");

        a.lineWidth = 1;
        a.strokeStyle = "white";
        polygons.forEach(function (p) {
          strokeOrFillPolygon(a, p, true);
        });

        var s = Date.now();
        var q = new Point(0, 0);
        for (var k = 0; k < 100; k++) {
          for (var j = 0; j < 100; j++) {
            var qx = x + k * 6;
            var qy = y + j * 6;

            var r = false;
            for (var i = 0; i < polygons.length; i++) {
              var bounds = polygonBounds[i];
              q.setElements(qx, qy);
              if (bounds.containsPoint(q)) {
                var inside = Shumway.GeometricUtilities.pointInPolygon(qx, qy, polygons[i]);
                if (inside) {
                  r = !r;
                }
              }
            }

            if (r) {
              a.fillStyle = "red";
            } else {
              a.fillStyle = "white";
            }
            a.fillRect(qx - 1, qy - 1, 2, 2);
          }
        }

        aResults.innerHTML = "Query Time: " + ((Date.now() - s)) + " ms / 10000";

        a.restore();
      }, 16);
    }

    function testG() {
      var paths = [
        [[643.45, 144.75], [643.75, 146.3], [644, 150.2], [644.05, 156.5, 641.9, 160.8], [639, 166.85, 632, 168], [623.3, 169.4, 608.85, 163.1], [605.9, 161.85, 602.65, 161.2], [598.5, 160.45, 595.2, 161.15], [586.35, 162.95, 585.85, 174.3], [585.7, 177.35, 587.55, 182.7], [589.45, 188.15, 592.4, 193.15], [595.65, 198.65, 599, 201.45], [602.9, 204.65, 606.15, 203.55], [609.35, 202.45, 612.35, 198.35], [614.35, 195.6, 617.15, 189.9], [620.55, 183.1, 621.7, 181.15], [624.4, 176.8, 627, 175.25], [628.5, 174.4, 629.95, 174.7], [631.4, 175.1, 632.55, 176.4], [635.1, 179.25, 635.05, 184.5], [635, 190.45, 631.35, 196.15], [627, 203.1, 618.2, 208.15], [613.65, 210.8, 612, 213.85], [610.45, 216.65, 611.4, 219.5], [612.25, 222.2, 615.05, 224.5], [617.75, 226.8, 621.65, 228.25], [625.55, 229.7, 629.75, 229.95], [634.2, 230.2, 638, 229], [647.05, 226.2, 649.65, 216.55], [652.05, 207.35, 654.85, 207.55], [655.95, 207.55, 657.3, 209.05], [659.8, 212.2], [662.35, 215.15], [663.7, 216.35, 665, 216], [668, 215.15, 670.95, 204.25], [673.95, 193.05, 670.3, 181.2], [667.45, 171.75, 660.5, 162.3], [655.5, 155.55, 649, 149.5], [645.05, 146], [643.45, 144.75]],
        [[159.6, 370.1], [193.3, 345.2, 208.75, 322.45], [204.75, 321.6, 200.85, 320.15], [192.9, 317.15, 187.35, 312.55], [181.55, 307.75, 179.8, 302.25], [178.05, 296.9, 180.5, 291.7], [175.9, 293.55], [171, 295.35, 166.5, 296.15], [159.3, 297.35, 153.05, 296], [142.05, 293.65, 135.95, 283.6], [135.9, 283.55], [123.85, 280.3, 117.25, 276.1], [112.5, 273.05, 108.6, 269.85], [119.75, 287, 124.4, 297.45], [131.95, 314.4, 129.55, 326.8], [127.1, 339.3, 109.65, 345.75], [100.5, 349.15, 88.2, 350.6], [87.6, 350.9], [78.25, 356.3, 74.8, 362.55], [71.65, 368.3, 73.6, 374.25], [75.35, 379.8, 81.15, 384.6], [86.7, 389.25, 94.65, 392.2], [101, 394.55, 107.7, 395.4], [102.75, 397.25], [94.9, 399.75, 85.8, 399.2], [77.2, 398.7, 69.1, 395.7], [61.15, 392.7, 55.6, 388.1], [49.8, 383.3, 48.05, 377.8], [46.3, 372.45, 48.75, 367.25], [44.15, 369.1], [31.5, 373.75, 21.3, 371.55], [10.3, 369.2, 4.2, 359.15], [-0.9, 350.7, -2.1, 337.4], [-36.7, 314.9, -26.25, 283.5], [-22.3, 271.7, -12.3, 259.9], [-4.35, 250.45, 5.2, 243.45], [52.05, 208.85, 63.55, 178.4], [72.7, 154, 58.95, 133.4], [49.15, 118.65, 28.85, 107.25], [22.5, 103.7, 15.85, 100.9], [10.5, 98.8], [17.25, 96.15], [26, 92.85, 35.75, 89.85], [67.2, 80.25, 98, 76.8], [141.05, 72, 176.7, 80.25], [183, 81.85], [181, 76.65, 177.7, 71.7], [167.9, 56.95, 147.6, 45.55], [141.25, 42, 134.6, 39.2], [129.25, 37.1], [136, 34.45], [144.75, 31.15, 154.5, 28.15], [185.95, 18.55, 216.75, 15.1], [259.8, 10.3, 295.45, 18.55], [339.95, 28.85, 370.2, 59.1], [387.35, 76.25, 393.55, 87.3], [398, 95.15, 396.8, 99.9], [396.1, 102.6, 393.55, 104.55], [391.75, 105.85, 389.1, 106.8], [384.7, 108.35, 375.1, 109.5], [363.75, 110.8, 360.45, 111.55], [353.15, 113.2, 350.95, 116.6], [346.2, 123.9, 363.2, 142.75], [371.15, 141.75], [414.2, 136.95, 449.85, 145.2], [494.35, 155.5, 524.6, 185.75], [526.55, 187.7], [539.4, 190.2], [545.7, 191.8], [543.7, 186.6, 540.4, 181.65], [530.6, 166.9, 510.3, 155.5], [503.95, 151.95, 497.3, 149.15], [491.95, 147.05], [498.7, 144.4], [507.45, 141.1, 517.2, 138.1], [548.65, 128.5, 579.45, 125.05], [622.5, 120.25, 658.15, 128.5], [702.65, 138.8, 732.9, 169.05], [750.05, 186.2, 756.25, 197.25], [760.7, 205.1, 759.5, 209.85], [758.8, 212.55, 756.25, 214.5], [754.45, 215.8, 751.8, 216.75], [747.4, 218.3, 737.8, 219.45], [723.15, 221.5], [715.85, 223.15, 713.65, 226.55], [708.05, 235.2, 732.9, 260.05], [758.9, 286.05, 751.25, 320.15], [748.05, 334.6, 739, 348.35], [737, 351.3], [734.3, 352, 731.3, 353], [705.35, 362], [689.4, 367.2, 679.4, 367.8], [647.35, 369.65, 638.95, 372.6], [635.2, 373.95, 633.25, 376.25], [629.9, 381.3], [626.6, 386.3, 618.35, 393.35], [610.85, 399.8, 609.65, 399.8], [608.4, 399.8, 606.15, 398.55], [603.9, 397.3, 602.65, 397.3], [594.75, 397.3, 578.45, 423.8], [573.2, 432.75], [568.3, 431.85, 563.55, 430.1], [555.6, 427.1, 550.05, 422.5], [544.4, 417.8, 542.6, 412.5], [538.15, 413.9, 529.25, 414.95], [514.6, 417], [507.3, 418.65, 505.1, 422.05], [499.5, 430.7, 524.35, 455.55], [550.35, 481.55, 542.7, 515.65], [541.85, 519.15], [550.35, 518.05], [593.4, 513.25, 629.05, 521.5], [635.35, 523.1], [633.35, 517.9, 630.05, 512.95], [620.25, 498.2, 599.95, 486.8], [593.6, 483.25, 586.95, 480.45], [581.6, 478.35], [588.35, 475.7], [597.1, 472.4, 606.85, 469.4], [638.3, 459.8, 669.1, 456.35], [712.15, 451.55, 747.8, 459.8], [792.3, 470.1, 822.55, 500.35], [839.7, 517.5, 845.9, 528.55], [850.35, 536.4, 849.15, 541.15], [848.45, 543.85, 845.9, 545.8], [844.1, 547.1, 841.45, 548.05], [837.05, 549.6, 827.45, 550.75], [816.1, 552.05, 812.8, 552.8], [805.5, 554.45, 803.3, 557.85], [797.7, 566.5, 822.55, 591.35], [848.55, 617.35, 840.9, 651.45], [837.7, 665.9, 828.65, 679.65], [826.65, 682.6], [820.95, 684.3], [804, 690.35, 795, 693.3], [779.05, 698.5, 769.05, 699.1], [737, 700.95, 728.6, 703.9], [724.85, 705.25, 722.9, 707.55], [719.55, 712.6], [716.25, 717.6, 708, 724.65], [700.5, 731.1, 699.3, 731.1], [698.05, 731.1, 695.8, 729.85], [693.55, 728.6, 692.3, 728.6], [684.4, 728.6, 668.1, 755.1], [662.85, 764.05], [657.95, 763.15, 653.2, 761.4], [645.25, 758.4, 639.7, 753.8], [633.9, 749, 632.15, 743.5], [630.4, 738.15, 632.85, 732.95], [628.25, 734.8], [623.35, 736.6, 618.85, 737.4], [611.65, 738.6, 605.4, 737.25], [594.4, 734.9, 588.3, 724.85], [588.25, 724.8], [576.2, 721.55, 569.6, 717.35], [564.85, 714.3, 560.95, 711.1], [572.1, 728.25, 576.75, 738.7], [584.3, 755.65, 581.9, 768.05], [579.45, 780.55, 562, 787], [552.85, 790.4, 540.55, 791.85], [539.95, 792.15], [530.6, 797.55, 527.15, 803.8], [524, 809.55, 525.95, 815.5], [527.7, 821.05, 533.5, 825.85], [539.05, 830.5, 547, 833.45], [553.35, 835.8, 560.05, 836.65], [555.1, 838.5], [547.25, 841, 538.15, 840.45], [529.55, 839.95, 521.45, 836.95], [513.5, 833.95, 507.95, 829.35], [502.15, 824.55, 500.4, 819.05], [498.65, 813.7, 501.1, 808.5], [496.5, 810.35], [483.85, 815, 473.65, 812.8], [462.65, 810.45, 456.55, 800.4], [451.45, 791.95, 450.25, 778.65], [432, 766.8, 426.3, 752.45], [418.25, 754.4, 412.35, 754.75], [380.3, 756.6, 371.9, 759.55], [368.15, 760.9, 366.2, 763.2], [362.85, 768.25], [359.55, 773.25, 351.3, 780.3], [343.8, 786.75, 342.6, 786.75], [341.35, 786.75, 339.1, 785.5], [336.85, 784.25, 335.6, 784.25], [327.7, 784.25, 311.4, 810.75], [306.15, 819.7], [301.25, 818.8, 296.5, 817.05], [288.55, 814.05, 283, 809.45], [277.2, 804.65, 275.45, 799.15], [273.7, 793.8, 276.15, 788.6], [271.55, 790.45], [266.65, 792.25, 262.15, 793.05], [254.95, 794.25, 248.7, 792.9], [237.7, 790.55, 231.6, 780.5], [231.55, 780.45], [219.5, 777.2, 212.9, 773], [208.15, 769.95, 204.25, 766.75], [215.4, 783.9, 220.05, 794.35], [227.6, 811.3, 225.2, 823.7], [222.75, 836.2, 205.3, 842.65], [196.15, 846.05, 183.85, 847.5], [183.25, 847.8], [173.9, 853.2, 170.45, 859.45], [167.3, 865.2, 169.25, 871.15], [171, 876.7, 176.8, 881.5], [182.35, 886.15, 190.3, 889.1], [196.65, 891.45, 203.35, 892.3], [198.4, 894.15], [190.55, 896.65, 181.45, 896.1], [172.85, 895.6, 164.75, 892.6], [156.8, 889.6, 151.25, 885], [145.45, 880.2, 143.7, 874.7], [141.95, 869.35, 144.4, 864.15], [139.8, 866], [127.15, 870.65, 116.95, 868.45], [105.95, 866.1, 99.85, 856.05], [94.75, 847.6, 93.55, 834.3], [58.95, 811.8, 69.4, 780.4], [73.35, 768.6, 83.35, 756.8], [91.3, 747.35, 100.85, 740.35], [147.7, 705.75, 159.2, 675.3], [160.45, 671.95, 161.3, 668.7], [159.7, 666.8, 158.35, 664.6], [153.25, 656.15, 152.05, 642.85], [126.45, 626.2, 125.55, 604.75], [124.5, 604.15], [118.15, 600.6, 111.5, 597.8], [106.15, 595.7], [112.9, 593.05], [120.25, 590.25, 128.35, 587.7], [132.4, 576.55, 141.85, 565.35], [149.8, 555.9, 159.35, 548.9], [188.35, 527.45, 203.85, 507.65], [202.95, 506.05, 202.45, 504.45], [200.7, 499.1, 203.15, 493.9], [198.55, 495.75], [185.9, 500.4, 175.7, 498.2], [164.7, 495.85, 158.6, 485.8], [153.5, 477.35, 152.3, 464.05], [117.7, 441.55, 128.15, 410.15], [132.1, 398.35, 142.1, 386.55], [150.05, 377.1, 159.6, 370.1]],
        [[756.8, 675.7], [756.8, 669.15, 748.85, 664.8], [741.7, 660.9, 731.3, 660.2], [721, 659.5, 713.75, 662.35], [705.8, 665.5, 705.8, 671.7], [705.8, 676.25, 713.85, 682.6], [722.6, 689.6, 731.3, 689.6], [734.8, 689.6, 737.55, 687.75], [740.8, 685.6], [756.8, 688.6, 756.8, 675.7]],
        [[820.8, 653.85], [820.8, 651.95, 820.25, 648.65], [823.8, 642.65, 823.8, 639.2], [823.8, 629.15, 813.8, 616.35], [804.4, 604.25, 791.8, 596.65], [778.45, 588.6, 769.8, 590.9], [760.5, 593.3, 759.85, 607.55], [758.8, 612.6], [757.15, 620.85, 754.6, 629.9], [753.8, 632.6, 753.8, 641.1], [753.9, 647.35], [754.5, 654.25, 757.3, 659.85], [766.1, 677.6, 793.3, 677.6], [803.8, 677.6, 813.05, 667.35], [816.45, 663.55, 818.75, 659.4], [820.8, 655.65, 820.8, 653.85]],
        [[671.8, 572.6], [663.55, 572.6, 655.7, 586.35], [652.75, 591.5, 650.75, 597.1], [648.95, 602.25, 648.95, 604.7], [648.95, 607.15, 650.45, 610.35], [652.9, 615.6, 657.95, 615.6], [664.45, 615.6, 674.55, 603.35], [678.3, 598.8, 681.15, 594.25], [683.8, 589.95, 683.8, 588.7], [683.8, 582.9, 682.85, 580.1], [680.25, 572.6, 671.8, 572.6]],
        [[733.1, 476.05], [733.4, 477.6], [733.65, 481.5], [733.7, 487.8, 731.55, 492.1], [728.65, 498.15, 721.65, 499.3], [712.95, 500.7, 698.5, 494.4], [695.55, 493.15, 692.3, 492.5], [688.15, 491.75, 684.85, 492.45], [676, 494.25, 675.5, 505.6], [675.35, 508.65, 677.2, 514], [679.1, 519.45, 682.05, 524.45], [685.3, 529.95, 688.65, 532.75], [692.55, 535.95, 695.8, 534.85], [699, 533.75, 702, 529.65], [704, 526.9, 706.8, 521.2], [710.2, 514.4, 711.35, 512.45], [714.05, 508.1, 716.65, 506.55], [718.15, 505.7, 719.6, 506], [721.05, 506.4, 722.2, 507.7], [724.75, 510.55, 724.7, 515.8], [724.65, 521.75, 721, 527.45], [716.65, 534.4, 707.85, 539.45], [703.3, 542.1, 701.65, 545.15], [700.1, 547.95, 701.05, 550.8], [701.9, 553.5, 704.7, 555.8], [707.4, 558.1, 711.3, 559.55], [715.2, 561, 719.4, 561.25], [723.85, 561.5, 727.65, 560.3], [736.7, 557.5, 739.3, 547.85], [741.7, 538.65, 744.5, 538.85], [745.6, 538.85, 746.95, 540.35], [749.45, 543.5], [752, 546.45], [753.35, 547.65, 754.65, 547.3], [757.65, 546.45, 760.6, 535.55], [763.6, 524.35, 759.95, 512.5], [757.1, 503.05, 750.15, 493.6], [745.15, 486.85, 738.65, 480.8], [734.7, 477.3], [733.1, 476.05]],
        [[667.15, 344.4], [667.15, 337.85, 659.2, 333.5], [652.05, 329.6, 641.65, 328.9], [631.35, 328.2, 624.1, 331.05], [616.15, 334.2, 616.15, 340.4], [616.15, 344.95, 624.2, 351.3], [632.95, 358.3, 641.65, 358.3], [645.15, 358.3, 647.9, 356.45], [651.15, 354.3], [667.15, 357.3, 667.15, 344.4]],
        [[731.15, 322.55], [731.15, 320.65, 730.6, 317.35], [734.15, 311.35, 734.15, 307.9], [734.15, 297.85, 724.15, 285.05], [714.75, 272.95, 702.15, 265.35], [688.8, 257.3, 680.15, 259.6], [670.85, 262, 670.2, 276.25], [669.15, 281.3], [667.5, 289.55, 664.95, 298.6], [664.15, 301.3, 664.15, 309.8], [664.25, 316.05], [664.85, 322.95, 667.65, 328.55], [676.45, 346.3, 703.65, 346.3], [714.15, 346.3, 723.4, 336.05], [726.8, 332.25, 729.1, 328.1], [731.15, 324.35, 731.15, 322.55]],
        [[708.7, 612.45], [694.05, 614.5], [686.75, 616.15, 684.55, 619.55], [679.9, 626.75, 696.25, 645.05], [734.85, 645.05], [731.4, 626.95, 723.7, 612.1], [722.5, 609.85], [718.05, 611.35, 708.7, 612.45]],
        [[435.15, 161.45], [435.45, 163], [435.7, 166.9], [435.75, 173.2, 433.6, 177.5], [430.7, 183.55, 423.7, 184.7], [415, 186.1, 400.55, 179.8], [397.6, 178.55, 394.35, 177.9], [387.65, 177.7], [391.35, 189.5, 389.85, 202.6], [394.05, 201.15, 398.45, 199.8], [406.9, 197.2, 415.35, 195.1], [417.05, 192.95, 418.7, 191.95], [420.2, 191.1, 421.65, 191.4], [423, 191.8, 424.15, 192.95], [440.85, 189.15, 457.45, 187.15], [455.2, 183.05, 452.2, 179], [447.2, 172.25, 440.7, 166.2], [436.75, 162.7], [435.15, 161.45]],
        [[667.8, 713.1], [667.8, 705.05, 662.95, 684.25], [658.6, 665.65, 656.2, 659.85], [654.25, 655.15, 649.5, 651.3], [644.85, 647.5, 639.25, 646.05], [633.3, 644.5, 628.35, 646.25], [622.8, 648.25, 619.7, 654.1], [618.95, 655.5, 618.75, 657.15], [618.5, 659.9], [618, 663.2, 613.7, 666.85], [608.95, 670.75, 608.95, 680.35], [608.95, 682.05, 610.9, 688.65], [613.65, 698.05, 618, 705.9], [631.6, 730.6, 654.95, 730.6], [664.6, 730.6, 667.1, 722.9], [667.8, 720.7, 667.8, 713.1]],
        [[413.35, 244.95], [417.25, 246.4, 421.45, 246.65], [423.7, 246.7], [421.65, 243.35], [415.9, 234.7, 406.55, 227.2], [404.65, 228.8, 403.7, 230.55], [402.15, 233.35, 403.1, 236.2], [403.95, 238.9, 406.75, 241.2], [409.45, 243.5, 413.35, 244.95]],
        [[387.8, 215.2], [390.7, 218.15], [394.1, 220.95, 397.05, 220.45], [391.55, 217.2], [387.8, 215.2]],
        [[331.1, 206.9], [337.4, 208.5], [335.4, 203.3, 332.1, 198.35], [323.25, 185, 305.8, 174.45], [304.35, 181.25, 302.25, 188.65], [301.45, 191.35, 301.45, 199.85], [301.5, 202.4], [316.9, 203.6, 331.1, 206.9]],
        [[373.85, 258], [365.6, 258, 357.75, 271.75], [354.8, 276.9, 352.8, 282.5], [351, 287.65, 351, 290.1], [351, 292.55, 352.5, 295.75], [354.95, 301, 360, 301], [366.5, 301, 376.6, 288.75], [380.35, 284.2, 383.2, 279.65], [385.85, 275.35, 385.85, 274.1], [385.85, 268.3, 384.9, 265.5], [382.3, 258, 373.85, 258]],
        [[410.75, 297.85], [399.4, 299.15, 396.1, 299.9], [388.8, 301.55, 386.6, 304.95], [383.55, 309.65, 389.5, 319.1], [398.3, 318.65, 406.8, 318.85], [417.25, 307, 423, 295.75], [418.6, 296.95, 410.75, 297.85]],
        [[311, 365.75], [311, 367.45, 312.95, 374.05], [314.3, 378.65, 316.05, 382.9], [330.85, 385.7], [337.15, 387.3], [335.15, 382.1, 331.85, 377.15], [324.75, 366.5, 312.2, 357.6], [311, 360.95, 311, 365.75]],
        [[460.15, 301.5], [456.65, 315.3], [455.9, 317.85, 455.85, 325.6], [457.5, 326.05], [461.6, 317.1, 469.15, 308.15], [473.15, 303.65], [466.4, 301.4, 460.15, 301.5]],
        [[582.15, 241.3], [573.9, 241.3, 566.05, 255.05], [563.1, 260.2, 561.1, 265.8], [559.3, 270.95, 559.3, 273.4], [559.3, 275.85, 560.8, 279.05], [563.25, 284.3, 568.3, 284.3], [574.8, 284.3, 584.9, 272.05], [588.65, 267.5, 591.5, 262.95], [594.15, 258.65, 594.15, 257.4], [594.15, 251.6, 593.2, 248.8], [590.6, 241.3, 582.15, 241.3]],
        [[410.05, 410.05], [403.1, 415.65], [404.05, 417.95, 406.5, 420], [409.2, 422.3, 413.1, 423.75], [417, 425.2, 421.2, 425.45], [425.65, 425.7, 429.45, 424.5], [437.65, 421.95, 440.55, 413.85], [439.15, 405.1, 435.2, 396.7], [433.55, 393.2, 431.1, 389.15], [430.65, 389.3], [426.9, 390.65, 424.95, 392.95], [421.6, 398], [418.3, 403, 410.05, 410.05]],
        [[619.05, 281.15], [607.7, 282.45, 604.4, 283.2], [597.1, 284.85, 594.9, 288.25], [590.25, 295.45, 606.6, 313.75], [645.2, 313.75], [641.75, 295.65, 634.05, 280.8], [632.85, 278.55], [628.4, 280.05, 619.05, 281.15]],
        [[529.5, 236.15], [514.85, 238.2], [514.05, 238.4], [516.35, 241.2, 516.3, 246.2], [516.25, 252.15, 512.6, 257.85], [510.55, 260.8], [515.8, 267.35], [533.6, 250.1, 541.8, 234], [537.4, 235.2, 529.5, 236.15]],
        [[219.45, 131.35], [211.2, 131.35, 203.35, 145.1], [200.4, 150.25, 198.4, 155.85], [196.6, 161, 196.6, 163.45], [196.6, 165.9, 198.1, 169.1], [200.55, 174.35, 205.6, 174.35], [212.1, 174.35, 222.2, 162.1], [225.95, 157.55, 228.8, 153], [231.45, 148.7, 231.45, 147.45], [231.45, 141.65, 230.5, 138.85], [227.9, 131.35, 219.45, 131.35]],
        [[162, 96.5], [162.3, 98.05], [162.55, 101.95], [162.6, 108.25, 160.45, 112.55], [157.55, 118.6, 150.55, 119.75], [141.85, 121.15, 127.4, 114.85], [124.45, 113.6, 121.2, 112.95], [117.05, 112.2, 113.75, 112.9], [104.9, 114.7, 104.4, 126.05], [104.25, 129.1, 106.1, 134.45], [108, 139.9, 110.95, 144.9], [114.2, 150.4, 117.55, 153.2], [121.45, 156.4, 124.7, 155.3], [127.9, 154.2, 130.9, 150.1], [132.9, 147.35, 135.7, 141.65], [140.25, 132.9], [142.95, 128.55, 145.55, 127], [147.05, 126.15, 148.5, 126.45], [149.95, 126.85, 151.1, 128.15], [153.65, 131, 153.6, 136.25], [153.55, 142.2, 149.9, 147.9], [145.55, 154.85, 136.75, 159.9], [132.2, 162.55, 130.55, 165.6], [129, 168.4, 129.95, 171.25], [130.6, 173.35, 132.5, 175.25], [170.95, 145, 181.8, 118.05], [179.05, 114.05], [174.05, 107.3, 167.55, 101.25], [163.6, 97.75], [162, 96.5]],
        [[280.75, 34.8], [281.05, 36.35], [281.3, 40.25], [281.35, 46.55, 279.2, 50.85], [276.3, 56.9, 269.3, 58.05], [260.6, 59.45, 246.15, 53.15], [243.2, 51.9, 239.95, 51.25], [235.8, 50.5, 232.5, 51.2], [223.65, 53, 223.15, 64.35], [223, 67.4, 224.85, 72.75], [226.75, 78.2, 229.7, 83.2], [232.95, 88.7, 236.3, 91.5], [240.2, 94.7, 243.45, 93.6], [246.65, 92.5, 249.65, 88.4], [251.65, 85.65, 254.45, 79.95], [257.85, 73.15, 259, 71.2], [261.7, 66.85, 264.3, 65.3], [265.8, 64.45, 267.25, 64.75], [268.7, 65.15, 269.85, 66.45], [272.4, 69.3, 272.35, 74.55], [272.3, 80.5, 268.65, 86.2], [264.3, 93.15, 255.5, 98.2], [250.95, 100.85, 249.3, 103.9], [247.75, 106.7, 248.7, 109.55], [249.55, 112.25, 252.35, 114.55], [255.05, 116.85, 258.95, 118.3], [262.85, 119.75, 267.05, 120], [271.5, 120.25, 275.3, 119.05], [284.35, 116.25, 286.95, 106.6], [289.35, 97.4, 292.15, 97.6], [293.25, 97.6, 294.6, 99.1], [297.1, 102.25], [299.65, 105.2], [301, 106.4, 302.3, 106.05], [305.3, 105.2, 308.25, 94.3], [311.25, 83.1, 307.6, 71.25], [304.75, 61.8, 297.8, 52.35], [292.8, 45.6, 286.3, 39.55], [282.35, 36.05], [280.75, 34.8]],
        [[522.85, 339.25], [522.7, 336.9], [519.7, 340.45, 519.35, 347.25], [520.8, 344.8], [522.85, 341.05, 522.85, 339.25]],
        [[530.7, 365.05], [528.7, 368], [527.95, 368.2], [542.15, 382.9, 547.7, 392.75], [549.35, 395.9], [556.65, 399.3, 565.3, 399.3], [574.95, 399.3, 577.45, 391.6], [578.15, 389.4, 578.15, 381.8], [578.15, 373.75, 573.3, 352.95], [568.95, 334.35, 566.55, 328.55], [564.6, 323.85, 559.85, 320], [555.2, 316.2, 549.6, 314.75], [544.2, 314.05], [545.6, 324.95, 542.95, 336.85], [539.75, 351.3, 530.7, 365.05]],
        [[493.85, 282.05], [492.7, 281.4], [493.4, 283.4, 495.2, 285.2], [496.8, 283.95], [493.85, 282.05]],
        [[252.4, 203.45], [282.1, 201.7], [278.6, 184.85, 271.35, 170.85], [270.15, 168.6], [265.7, 170.1, 256.35, 171.2], [241.7, 173.25], [234.4, 174.9, 232.2, 178.3], [227.55, 185.5, 243.9, 203.8], [249.4, 203.8], [252.4, 203.45]],
        [[317.45, 149.65], [313.25, 150.75, 310.85, 154.25], [318.85, 151.8, 326.85, 149.85], [321.6, 148.55, 317.45, 149.65]],
        [[77.55, 207.8], [77.55, 218.95, 86.65, 235.55], [90.6, 242.25], [88.95, 232.55, 92.5, 221.8], [96.45, 210, 106.45, 198.2], [110.45, 193.7], [100.4, 190.35, 91.45, 192.15], [85.05, 193.45, 81.35, 197.45], [77.55, 201.55, 77.55, 207.8]],
        [[78.6, 313.35], [78.6, 299.7, 72.5, 286.75], [67.2, 275.6, 54.35, 259.35], [44.2, 251, 30.2, 254.4], [24.25, 255.9, 20, 259.2], [16.35, 262.1, 15.05, 265.5], [13.25, 267, 11.8, 269.2], [7.6, 275.6, 7.6, 285.7], [7.45, 287.8], [7.45, 289.3, 7.75, 290.65], [7.6, 291.95, 7.6, 293.45], [7.6, 306.3, 18.35, 317.9], [30.8, 331.35, 49.6, 331.35], [69.8, 331.35, 75.65, 325.4], [77.85, 323.1, 78.4, 319.6], [78.6, 318.2, 78.6, 313.35]],
        [[171.65, 222.8], [180.4, 219.5, 190.15, 216.5], [200.7, 213.45], [197.15, 210.05], [192.5, 206.25, 186.9, 204.8], [180.95, 203.25, 176, 205], [170.45, 207, 167.35, 212.85], [166.6, 214.25, 166.4, 215.9], [166.15, 218.65], [165.65, 221.95, 161.35, 225.6], [156.6, 229.5, 156.6, 239.1], [156.6, 240.8, 158.55, 247.4], [161.3, 256.8, 165.65, 264.65], [179.25, 289.35, 202.6, 289.35], [212.25, 289.35, 214.75, 281.65], [215.45, 279.45, 215.45, 271.85], [215.45, 268.15, 214.45, 261.7], [213.35, 260.05], [203.55, 245.3, 183.25, 233.9], [176.9, 230.35, 170.25, 227.55], [164.9, 225.45], [171.65, 222.8]],
        [[70.8, 351.6], [49.4, 351.8, 28.5, 347.8], [20.25, 346], [25.2, 349.65, 31.85, 352.15], [39.95, 355.15, 48.55, 355.65], [57.65, 356.2, 65.5, 353.7], [68.35, 352.8, 70.9, 351.6], [70.8, 351.6]],
        [[316.4, 223.15], [316.7, 224.7], [316.95, 228.6], [316.9, 231.15], [322.15, 234.1, 329.2, 235.4], [325.85, 231.5, 321.95, 227.9], [318, 224.4], [316.4, 223.15]],
        [[268.15, 239.55], [264.8, 240.25, 262.7, 242.25], [270.85, 248.35, 278.95, 248.35], [282.45, 248.35, 285.2, 246.5], [288.45, 244.35], [290.05, 244.65], [286.2, 243.4, 281.8, 241.5], [278.85, 240.25, 275.6, 239.6], [271.45, 238.85, 268.15, 239.55]],
        [[290.1, 268.3], [293.5, 261.5, 294.65, 259.55], [294.7, 259.55], [281.25, 260.9, 276.25, 262.65], [272.5, 264, 270.55, 266.3], [267.2, 271.35], [266.15, 272.85], [269, 277.4, 271.95, 279.85], [275.85, 283.05, 279.1, 281.95], [282.3, 280.85, 285.3, 276.75], [287.3, 274, 290.1, 268.3]],
        [[284.95, 292.25], [283.4, 295.05, 284.35, 297.9], [285, 300, 286.9, 301.9], [317.75, 277.65, 330.85, 255.5], [322.7, 257.5, 316.7, 257.85], [307.45, 258.45], [308, 260.4, 308, 262.9], [307.95, 268.85, 304.3, 274.55], [299.95, 281.5, 291.15, 286.55], [286.6, 289.2, 284.95, 292.25]],
        [[231.95, 334.45], [231.95, 345.6, 241.05, 362.2], [245, 368.9], [243.35, 359.2, 246.9, 348.45], [250.85, 336.65, 260.85, 324.85], [264.85, 320.35], [254.8, 317, 245.85, 318.8], [239.45, 320.1, 235.75, 324.1], [231.95, 328.2, 231.95, 334.45]],
        [[249.05, 518.85], [250.05, 519.2], [254, 511.45, 260.6, 503.65], [264.6, 499.15], [254.55, 495.8, 245.6, 497.6], [239.2, 498.9, 235.5, 502.9], [233.35, 505.25, 232.4, 508.3], [235.55, 511.25], [241.1, 515.9, 249.05, 518.85]],
        [[174.65, 472.65], [179.6, 476.3, 186.25, 478.8], [194.35, 481.8, 202.95, 482.3], [211.4, 482.8, 218.8, 480.7], [219.55, 478.25], [201, 477.9, 182.9, 474.45], [174.65, 472.65]],
        [[282.05, 458.9], [283.55, 457.6, 285.05, 455.55], [287.05, 452.8, 289.85, 447.1], [293.25, 440.3, 294.4, 438.35], [297.1, 434, 299.7, 432.45], [301.2, 431.6, 302.65, 431.9], [304.1, 432.3, 305.25, 433.6], [307.8, 436.45, 307.75, 441.7], [307.7, 447.65, 304.05, 453.35], [299.7, 460.3, 290.9, 465.35], [286.35, 468, 284.7, 471.05], [283.15, 473.85, 284.1, 476.7], [284.75, 478.8, 286.65, 480.7], [321.9, 453, 333.95, 428.05], [332.95, 424.3, 334.05, 420.65], [333.2, 419.5], [332.95, 419.2], [330.3, 420.2], [325.4, 422, 320.9, 422.8], [310.25, 423.15], [307.9, 424.65, 304.7, 425.2], [296, 426.6, 281.55, 420.3], [278.95, 419.2, 276.15, 418.6], [278.8, 424.1], [286.35, 441.05, 283.95, 453.45], [283.4, 456.3, 282.05, 458.9]],
        [[204, 458], [214.05, 458, 220.55, 456.55], [218.8, 447.35, 213.1, 438.85], [203.3, 424.1, 183, 412.7], [176.65, 409.15, 170, 406.35], [164.65, 404.25], [171.4, 401.6], [180.15, 398.3, 189.9, 395.3], [200.7, 392, 211.45, 389.45], [208.75, 386], [198.6, 377.65, 184.6, 381.05], [178.65, 382.55, 174.4, 385.85], [170.75, 388.75, 169.45, 392.15], [167.65, 393.65, 166.2, 395.85], [162, 402.25, 162, 412.35], [161.85, 414.45], [161.85, 415.95, 162.15, 417.3], [162, 418.6, 162, 420.1], [162, 432.95, 172.75, 444.55], [185.2, 458, 204, 458]],
        [[240.2, 525.85], [233.8, 525.15], [235.5, 529.95], [241.1, 527.9, 247.1, 526], [247.15, 525.8], [243.75, 526.05, 240.2, 525.85]],
        [[169.2, 570.95], [167.4, 572.45, 165.95, 574.65], [164.8, 576.4, 164, 578.45], [178.9, 575.35, 193.65, 573.7], [214.1, 572.15], [208.5, 564.8], [198.35, 556.45, 184.35, 559.85], [178.4, 561.35, 174.15, 564.65], [170.5, 567.55, 169.2, 570.95]],
        [[244.75, 547.7], [244.35, 545.4, 244.25, 543.05], [243.25, 542.45], [240.9, 541.15], [244.75, 547.7]],
        [[232.75, 618.8], [232.65, 615.3], [228.2, 614, 223.05, 611.75], [220.1, 610.5, 216.85, 609.85], [212.7, 609.1, 209.4, 609.8], [200.55, 611.6, 200.05, 622.95], [199.9, 626, 201.75, 631.35], [202.7, 634.15, 204, 636.8], [224, 636.75, 229.8, 630.85], [232, 628.55, 232.55, 625.05], [232.75, 623.65, 232.75, 618.8]],
        [[315.1, 628.25], [306.85, 628.25, 299, 642], [296.05, 647.15, 294.05, 652.75], [292.25, 657.9, 292.25, 660.35], [292.25, 662.8, 293.75, 666], [296.2, 671.25, 301.25, 671.25], [307.75, 671.25, 317.85, 659], [321.6, 654.45, 324.45, 649.9], [327.1, 645.6, 327.1, 644.35], [327.1, 638.55, 326.15, 635.75], [323.55, 628.25, 315.1, 628.25]],
        [[174.25, 810.25], [174.25, 796.6, 168.15, 783.65], [162.85, 772.5, 150, 756.25], [139.85, 747.9, 125.85, 751.3], [119.9, 752.8, 115.65, 756.1], [112, 759, 110.7, 762.4], [108.9, 763.9, 107.45, 766.1], [103.25, 772.5, 103.25, 782.6], [103.1, 784.7], [103.1, 786.2, 103.4, 787.55], [103.25, 788.85, 103.25, 790.35], [103.25, 803.2, 114, 814.8], [126.45, 828.25, 145.25, 828.25], [165.45, 828.25, 171.3, 822.3], [173.5, 820, 174.05, 816.5], [174.25, 815.1, 174.25, 810.25]],
        [[369.6, 577.3], [369.6, 570.5, 366.15, 554.7], [364.95, 554.95], [356.25, 556.35, 341.8, 550.05], [338.85, 548.8, 335.6, 548.15], [331.45, 547.4, 328.15, 548.1], [319.3, 549.9, 318.8, 561.25], [318.65, 564.3, 320.5, 569.65], [321.35, 572.15, 322.5, 574.6], [329.6, 585.5, 339.05, 590.55], [339.1, 590.5], [342.3, 589.4, 345.3, 585.3], [347.3, 582.55, 350.1, 576.85], [353.5, 570.05, 354.65, 568.1], [357.35, 563.75, 359.95, 562.2], [361.45, 561.35, 362.9, 561.65], [364.35, 562.05, 365.5, 563.35], [368.05, 566.2, 368, 571.45], [367.95, 577.4, 364.3, 583.1], [360.2, 589.65, 352.1, 594.55], [356.75, 594.8], [366.4, 594.8, 368.9, 587.1], [369.6, 584.9, 369.6, 577.3]],
        [[242.35, 656.05], [241.75, 656.35], [232.4, 661.75, 228.95, 668], [228, 669.75, 227.55, 671.5], [228.15, 672.15], [239, 663.6, 247.7, 655.3], [242.35, 656.05]],
        [[173.2, 704.7], [173.2, 715.85, 182.3, 732.45], [186.25, 739.15], [184.6, 729.45, 188.15, 718.7], [192.1, 706.9, 202.1, 695.1], [206.1, 690.6], [196.05, 687.25, 187.1, 689.05], [180.7, 690.35, 177, 694.35], [173.2, 698.45, 173.2, 704.7]],
        [[311.1, 768.75], [311.1, 760.7, 306.25, 739.9], [301.9, 721.3, 299.5, 715.5], [297.55, 710.8, 292.8, 706.95], [288.15, 703.15, 282.55, 701.7], [276.6, 700.15, 271.65, 701.9], [266.1, 703.9, 263, 709.75], [262.25, 711.15, 262.05, 712.8], [261.8, 715.55], [261.3, 718.85, 257, 722.5], [252.25, 726.4, 252.25, 736], [252.25, 737.7, 254.2, 744.3], [256.95, 753.7, 261.3, 761.55], [274.9, 786.25, 298.25, 786.25], [307.9, 786.25, 310.4, 778.55], [311.1, 776.35, 311.1, 768.75]],
        [[611.25, 463.75], [610.35, 460.2, 611.25, 456.8], [611.25, 463.75]],
        [[522.6, 518.05], [522.6, 516.15, 522.05, 512.85], [525.6, 506.85, 525.6, 503.4], [525.6, 493.35, 515.6, 480.55], [506.2, 468.45, 493.6, 460.85], [482.85, 454.35, 475.15, 454.6], [472.35, 455.7], [467, 457.45], [462.1, 461.6, 461.65, 471.75], [460.6, 476.8], [458.95, 485.05, 456.4, 494.1], [455.8, 496.15, 455.65, 501.5], [457.35, 502.15], [463.7, 504.5, 470.4, 505.35], [465.45, 507.2], [460.8, 508.7, 455.65, 509.1], [455.7, 511.55], [456.3, 518.45, 459.1, 524.05], [463.2, 532.35, 471.35, 536.75], [479.3, 533.8, 488.1, 531.1], [504.65, 526.05, 521.05, 522.7], [522.6, 519.65, 522.6, 518.05]],
        [[515.9, 619.65], [525.05, 595.25, 511.3, 574.65], [505.35, 565.65, 495.5, 557.95], [481.9, 562.25, 472.8, 563.15], [484.35, 575.55, 489.2, 584.2], [493.65, 592.05, 492.45, 596.8], [491.75, 599.5, 489.2, 601.45], [487.4, 602.75, 484.75, 603.7], [480.35, 605.25, 470.75, 606.4], [456.1, 608.45], [448.8, 610.1, 446.6, 613.5], [441, 622.15, 465.85, 647], [475.1, 656.25, 480.1, 666.5], [507.5, 641.95, 515.9, 619.65]],
        [[614.35, 537.75], [614.65, 539.3], [614.9, 543.2], [614.95, 549.5, 612.8, 553.8], [609.9, 559.85, 602.9, 561], [594.2, 562.4, 579.75, 556.1], [576.8, 554.85, 573.55, 554.2], [569.4, 553.45, 566.1, 554.15], [557.25, 555.95, 556.75, 567.3], [556.6, 570.35, 558.45, 575.7], [560.35, 581.15, 563.3, 586.15], [566.55, 591.65, 569.9, 594.45], [573.8, 597.65, 577.05, 596.55], [580.25, 595.45, 583.25, 591.35], [585.25, 588.6, 588.05, 582.9], [591.45, 576.1, 592.6, 574.15], [595.3, 569.8, 597.9, 568.25], [599.4, 567.4, 600.85, 567.7], [602.3, 568.1, 603.45, 569.4], [606, 572.25, 605.95, 577.5], [605.9, 583.45, 602.25, 589.15], [597.9, 596.1, 589.1, 601.15], [584.55, 603.8, 582.9, 606.85], [581.35, 609.65, 582.3, 612.5], [582.95, 614.6, 584.85, 616.5], [623.3, 586.25, 634.15, 559.3], [631.4, 555.3], [626.4, 548.55, 619.9, 542.5], [615.95, 539], [614.35, 537.75]],
        [[402.95, 480.45], [402.95, 480.35], [394.85, 482.7, 387.9, 482.1], [386.95, 482.85, 386.35, 483.75], [381.7, 490.95, 398.05, 509.25], [436.65, 509.25], [436.25, 507.1], [431.8, 505.65], [423.85, 502.65, 418.3, 498.05], [412.5, 493.25, 410.75, 487.75], [409, 482.4, 411.45, 477.2], [406.85, 479.05], [402.95, 480.35], [402.95, 480.45]],
        [[352.25, 474.55], [354.7, 479.8, 359.75, 479.8], [364.25, 479.8, 370.5, 473.9], [368.5, 471.8, 366.9, 469.1], [362.05, 461.05, 360.75, 448.55], [359, 448.05], [357.5, 450.55], [354.55, 455.7, 352.55, 461.3], [350.75, 466.45, 350.75, 468.9], [350.75, 471.35, 352.25, 474.55]],
        [[382.95, 455.95], [384, 456.7], [384.25, 456.3], [382.95, 455.95]],
        [[341.05, 510.25], [335.1, 508.7, 330.15, 510.45], [329.8, 510.6], [341.05, 510.25]],
        [[382.6, 603.5], [383.7, 599.9], [378.7, 605.5, 372.3, 615.5], [380.2, 612.4, 382.6, 603.5]],
        [[397.6, 594.05], [395.35, 592.8, 394.1, 592.8], [391.9, 592.8, 389, 594.9], [389.6, 595.25, 390.25, 596], [392.75, 599.15], [395.3, 602.1], [396.65, 603.3, 397.95, 602.95], [400.5, 602.25, 403, 594.35], [401.55, 595.3, 401.1, 595.3], [399.85, 595.3, 397.6, 594.05]],
        [[440.05, 701.15], [448, 691.7, 457.55, 684.7], [462.9, 680.7], [460.6, 676.5, 457.1, 672], [447.7, 659.9, 435.1, 652.3], [421.75, 644.25, 413.1, 646.55], [403.8, 648.95, 403.15, 663.2], [402.1, 668.25], [400.45, 676.5, 397.9, 685.55], [397.1, 688.25, 397.1, 696.75], [397.2, 703], [397.8, 709.9, 400.6, 715.5], [407.2, 728.85, 424.25, 732.15], [424.85, 728.5, 426.1, 724.75], [430.05, 712.95, 440.05, 701.15]],
        [[458.6, 539.9], [458.6, 533.35, 450.65, 529], [443.5, 525.1, 433.1, 524.4], [426.1, 523.9, 420.5, 525.1], [440.2, 533.7, 456.4, 547.3], [458.6, 544.7, 458.6, 539.9]],
        [[352, 668.1], [337.35, 670.15], [330.05, 671.8, 327.85, 675.2], [323.2, 682.4, 339.55, 700.7], [378.15, 700.7], [374.7, 682.6, 367, 667.75], [365.8, 665.5], [361.35, 667, 352, 668.1]],
        [[400.1, 731.35], [400.1, 724.8, 392.15, 720.45], [385, 716.55, 374.6, 715.85], [364.3, 715.15, 357.05, 718], [349.1, 721.15, 349.1, 727.35], [349.1, 731.9, 357.15, 738.25], [365.9, 745.25, 374.6, 745.25], [378.1, 745.25, 380.85, 743.4], [384.1, 741.25], [400.1, 744.25, 400.1, 731.35]],
        [[530.75, 760.85], [530.95, 759.45, 530.95, 754.6], [530.95, 740.95, 524.85, 728], [519.55, 716.85, 506.7, 700.6], [497.75, 693.25, 485.9, 695], [485.6, 700.9, 484.2, 707.1], [481, 721.55, 471.95, 735.3], [469.95, 738.25], [464.25, 739.95], [460.65, 741.25], [462.7, 750.55, 470.7, 759.15], [483.15, 772.6, 501.95, 772.6], [522.15, 772.6, 528, 766.65], [530.2, 764.35, 530.75, 760.85]],
        [[462.05, 715.05], [463.45, 712.5, 463.9, 710.85], [462.45, 713.15, 461.55, 715.95], [462.05, 715.05]],
        [[523.15, 792.85], [501.75, 793.05, 480.85, 789.05], [472.6, 787.25], [477.55, 790.9, 484.2, 793.4], [492.3, 796.4, 500.9, 796.9], [510, 797.45, 517.85, 794.95], [523.25, 792.85], [523.15, 792.85]],
        [[529.9, 649.05], [529.9, 660.2, 539, 676.8], [542.95, 683.5], [541.3, 673.8, 544.85, 663.05], [548.8, 651.25, 558.8, 639.45], [562.8, 634.95], [552.75, 631.6, 543.8, 633.4], [537.4, 634.7, 533.7, 638.7], [529.9, 642.8, 529.9, 649.05]],
        [[344.2, 850.7], [343.3, 847.15, 344.2, 843.75], [344.2, 850.7]],
        [[166.45, 848.5], [145.05, 848.7, 124.15, 844.7], [115.9, 842.9], [120.85, 846.55, 127.5, 849.05], [135.6, 852.05, 144.2, 852.55], [153.3, 853.1, 161.15, 850.6], [164, 849.7, 166.55, 848.5], [166.45, 848.5]],
        [[700.9, 795.05], [700, 791.5, 700.9, 788.1], [700.9, 795.05]]
      ];

      for (var i = 0; i < paths.length; i++) {
        paths[i].style = Shumway.ColorStyle.randomStyle();
      }
      var pointInPolygon = Shumway.GeometricUtilities.pointInPolygon;
      var clockwise = Shumway.GeometricUtilities.clockwise;
      var counterClockwise = Shumway.GeometricUtilities.counterClockwise;

      var polygons = [];
      var polygonBounds = [];
      for (var i = 0; i < paths.length; i++) {
        var path = paths[i];
        var points = [];
        var x0 = 0, y0 = 0;
        for (var j = 0; j < path.length; j++) {
          var command = path[j];
          if (command.length === 2) {
            var x0 = command[0] * 20, y0 = command[1] * 20;
            points.push(x0, y0);
          } else {
            var x1 = command[0] * 20, y1 = command[1] * 20;
            var x2 = command[2] * 20, y2 = command[3] * 20;
            if (counterClockwise(x0, y0, x1, y1, x2, y2)) {
              points.push(x1, y1, x2, y2);
            } else {
              points.push(x2, y2);
            }
            x0 = x2, y0 = y2;
          }
        }
        points.push(points[0]);
        points.push(points[1]);
        var polygon = new Int32Array(points);
        polygons.push(polygon);
        polygonBounds.push(getPolygonBounds(polygon));
      }

      var x = 0, y = 0;
      setInterval(function () {
        a.save();
        a.scale(1.5, 1.5);
        x += 1;
        a.clearRect(0, 0, 2048, 2048);
        var s = Date.now();

        a.beginPath();
        paths.forEach(function (p) {
          a.fillStyle = p.style;
          createPath(a, p, false);
        });
        a.closePath();
        a.fill("evenodd");

        a.lineWidth = 1;
        a.strokeStyle = "white";
        a.save();
        a.scale(1 / 20, 1 / 20);
        a.lineWidth = 20;
        polygons.forEach(function (p) {
          strokeOrFillPolygon(a, p, true);
        });
        a.restore();

        var s = Date.now();
        var q = new Point(0, 0);
        for (var k = 0; k < 100; k++) {
          for (var j = 0; j < 100; j++) {
            var qx = x + k * 6;
            var qy = y + j * 6;

            var r = false;
            for (var i = 0; i < polygons.length; i++) {
              var bounds = polygonBounds[i];
              q.setElements(qx * 20, qy * 20);
              if (bounds.containsPoint(q)) {
                var inside = Shumway.GeometricUtilities.pointInPolygonInt32(qx * 20, qy * 20, polygons[i]);
                if (inside) {
                  r = !r;
                }
              }
            }

            if (r) {
              a.fillStyle = "red";
            } else {
              a.fillStyle = "white";
            }
            a.fillRect(qx - 1, qy - 1, 2, 2);
          }
        }

        aResults.innerHTML = "Query Time: " + ((Date.now() - s)) + " ms / 10000";

        a.restore();
      }, 16);
    }

  </script>
  <br>
  <button onclick="testA()">Scale & Rotate</button>
  <button onclick="testB()">Translate & Rotate</button>
  <button onclick="testC()">Skew</button>
  <button onclick="testD()">OOB Check</button>
  <button onclick="testE()">Point in Polygon Test</button>
  <button onclick="testF()">Point in Polygon Test 2</button>
  <button onclick="testG()">Point in Polygon Test 2 - Twips</button>
</body>
</html>